How do I pass multiple parameters in Objective-C?

I have read several of the post about Objective-C method syntax but I guess I don’t understand multiple names for a method. I’m trying to create a method called getBusStops with NSString and NSTimeInterval parameters and a return type of NSMutableArray. This is how I have constructed the method but it obviously gets errors at … Read more

What are the details of “Objective-C Literals” mentioned in the Xcode 4.4 release notes?

I was going through the release notes for Xcode 4.4 and noticed this: LLVM 4.0 Compiler Xcode now includes the Apple LLVM Compiler version 4.0, including the following newObjective-C language features: […] – Objective-C literals: create literals for NSArray, NSDictionary, and NSNumber, just the same as the literals for NSString I’m intrigued about this feature. … Read more

In Objective-C, what is the equivalent of Java’s “instanceof” keyword?

I would like to check whether an object (e.g. someObject) is assignable (cast-able) to a variable of another type (e.g. SpecifiedType). In Java, I can write: someObject instanceof SpecifiedType A related question is finding whether the runtime type of an object is equal to a another type. In Java, I can write: someObject.getClass().equals(SpecifiedType.class) How can … Read more

Objective-C implicit conversion loses integer precision ‘NSUInteger’ (aka ‘unsigned long’) to ‘int’ warning

I’m working through some exercises and have got a warning that states: Implicit conversion loses integer precision: ‘NSUInteger’ (aka ‘unsigned long’) to ‘int’ #import <Foundation/Foundation.h> int main (int argc, const char * argv[]) { @autoreleasepool { NSArray *myColors; int i; int count; myColors = @[@”Red”, @”Green”, @”Blue”, @”Yellow”]; count = myColors.count; // <<< issue warning … Read more