Forums > Dev

again: problem with declaring a NSInteger

Sep 12 2010 | 7:57 pm

Hi again,

I have added all the frameworks required by a Cocoa Application (AppKit.framework, Cocoa.framework, CoreData.framework, Foundation.framework) to my external, but when I try to declare a NSInteger;

NSInteger myNSInt

I receive an error: ‘NSInteger’ undeclared (first use in this function).

I can’t explain this problem; especially because of the fact that I can use all other NS classes. Why not NSInteger?

Sep 13 2010 | 7:07 pm

Chances are you are using the 10.4 SDK. configuring it to use the 10.5 SDK can be a pain, but perhaps Tim can shed light on this if necessary. Otherwise, you might be fine just using NSNumber.


Sep 14 2010 | 7:53 pm

Well, I am using MaxSDK 5.0.6


Sep 14 2010 | 8:31 pm

I was referring to the OS SDK, for which NSInteger only exists in the 10.5 SDK or later. This is really a trivial typedef, and if you need it without using the 10.5 SDK or later, you can simply use the following:

typedef long NSInteger;
typedef int NSInteger;

Viewing 4 posts - 1 through 4 (of 4 total)

Forums > Dev