Category Archives: Objective-C

(Objective-C) Basic NSTableView Control Functions (Cocoa Framework)

Basic NSTableView Control Functions

Posted in Objective-C | Tagged , , , , , , , , | Leave a comment

(Objective C) Importing Header Files

In your header, @class suffices 90% of the time.

Posted in Objective-C | Tagged , , , , , , , , | Leave a comment

(Objective C) Global Constants II

Equality can be tested with: stringInstance == MyFirstConstant, not necessary to do a string comparison (isEqualToString)

Posted in Objective-C | Tagged , , , , , , , | Leave a comment

(Objective C) Play a sound file

// Play sound //To load sound file. +(void) playSound:(NSString *)fileName { NSString *path = [NSString stringWithFormat:@"%@/%@",[[NSBundle mainBundle] resourcePath],fileName];</code> <code>//declare a system sound id SystemSoundID soundID; //Get a URL for the sound file NSURL *filePath = [NSURL fileURLWithPath:path isDirectory:NO]; //Use audio sevices to create the sound AudioServicesCreateSystemSoundID((CFURLRef)filePath, &soundID); </code> <code> //Use audio services to play the [...]

Posted in Objective-C | Tagged , , , , , , , , | Leave a comment

(iPhone) Detect back button touch on UINavigationController

Code taken from comment by ‘William Jockusch’ in the URL.

Posted in Objective-C | Tagged , , , | Leave a comment

(iPhone) Adding left button to UINavigationBar

Posted in Objective-C | Tagged , , , , | Leave a comment

(iPhone) Drawing with OpenGL

Posted in Objective-C | Tagged , , , , | 1 Comment

(iPhone) IOS TableViews in Navigation Controller

Pulls data from a plist set up as a dictionary of arrays of strings. Creates multi-level TableView that can be nested inside a navigation controller. Snippet shows key methods for 2 nested levels. 2 levels –> 2 classes (both of which extend UITableViewController)

Posted in Objective-C | Tagged , , , , | Leave a comment

(iPhone) NSPredicate for Text Length & Email Validation

Posted in Objective-C | Tagged , , , , | Leave a comment

(iPhone) Remove Keyboard

background tap – background should have type UIControl and method should be connected to the “touch down” action textView – doesn’t need to be connected to an action, but delegate needs to be connected to something that is a UITextViewDelegate textField – delegate needs to be connected to something that is a UITextFieldDelegate and method [...]

Posted in Objective-C | Tagged , , , , | Leave a comment