What is a typedef enum in Objective-C?

Three things are being declared here: an anonymous enumerated type is declared, ShapeType is being declared a typedef for that anonymous enumeration, and the three names kCircle, kRectangle, and kOblateSpheroid are being declared as integral constants. Let’s break that down. In the simplest case, an enumeration can be declared as enum tagname { … }; … Read more

Shortcuts in Objective-C to concatenate NSStrings

An option: [NSString stringWithFormat:@”%@/%@/%@”, one, two, three]; Another option: I’m guessing you’re not happy with multiple appends (a+b+c+d), in which case you could do: NSLog(@”%@”, [Util append:one, @” “, two, nil]); // “one two” NSLog(@”%@”, [Util append:three, @”https://stackoverflow.com/”, two, @”https://stackoverflow.com/”, one, nil]); // three/two/one using something like + (NSString *) append:(id) first, … { NSString … Read more

How can I disable ARC for a single file in a project?

It is possible to disable ARC for individual files by adding the -fno-objc-arc compiler flag for those files. You add compiler flags in Targets -> Build Phases -> Compile Sources. You have to double click on the right column of the row under Compiler Flags. You can also add it to multiple files by holding … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)