Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'NSString undeclared'

This is extremely silly, but I can't figure out how to use an NSString in my iPhone app musings.

I haven't imported anything special (just stdio.h). When I tried declaring:

NSString *test = @"Hello World"

and compiled, I get the error: 'NSString undeclared'

How do I fix this? Also, when I try adding

#import <Foundation/Foundation.h>

I get 3951 build errors.

like image 386
Tony Stark Avatar asked Oct 26 '25 09:10

Tony Stark


2 Answers

I haven't imported anything special (just stdio.h).

You should #import <Foundation/Foundation.h>

You Application should be of type Foundationalt text

like image 175
Mahesh Avatar answered Oct 29 '25 06:10

Mahesh


You need to import Foundation.h. You probably don't need or want stdio.h.

like image 27
Carl Norum Avatar answered Oct 29 '25 05:10

Carl Norum