User:Dan Lynch
From CS 160 User Interfaces Sp10
Contents |
Links to Assignments
Programming
Other
Group H
iPhone Links example projects and code
iPhone as pedometer [1]
Google Code iPhone-pedometer [2]
iPhone accelerometer [3]
OpenGL [4]
CHDataStructures [5]
ASIHTTPREQUEST [6]
NSURL [7]
Objective-C errors [8]
iPhones Graphics [9]
UIPicker (good site overall) [10]
SQLite [11]
Classes in objective-C
In the header file for the class:
@interface className : parentClass <prototype> {
// member variables
}
// no parameters
- (returnType) methodName;
// on parameter
- (returnType) methodName : (argType) argName;
// two parameters or more, all but the first get a name in front, the first gets the method name
- (returnType) methodName : (argType) argName argumentTwo: (argType) argName2;
@end
To call a method of a class:
MyClass * object = [[MyClass alloc] init]; // call like this [object methodName: arg1 argumentTwo: arg2];
keyboard responder
- Check whether you pointed the delegate of the UITextField to the file owner
- check whether you pointed the fileowners parameter for the textfield to the actual GUI object
- Check your code. it should look something like this:
- (BOOL) textFieldShouldReturn:(UITextField *)theTextField {
if (theTextField == checkAmount) {
[theTextField resignFirstResponder];
}
return YES;
}
Audio
- make sure to add framework!
- Toggle open targets in xcode "Groups and Files"
- Double click project name
- Add AudioToolbox.framework
For the most optimized use .caf files.
/usr/bin/afconvert -f caff -d LEI16 myAlert.aif snd.caf
Simulating Touches
- Multi-touch: Hold down the Option key and click/drag
- two finger scroll: Option+Shift
