A beginner's mistake:
.h
@interface {
NSMutableDictionary myDict;
}
@property (nonatomic, retain) NSMutableDictionary myDict;
*.m
@synthesize myDict;
...
myDict = [[NSMutableDictionary dictionaryWithObjectsAndKeys: ..., ..., nil] retain];
If NSMutableDictionary is created with NSMutableDictionary dictionaryWithObjectsAndKeys, and it should be retained, it has to been sent a retain message explicitly.
No alloc, no init, no retain...
Search for "Header Search Paths" in Project Info, and add the path to your headers. (MacPorts headers live in /opt/local/include)
Also: #include is for System Header files.
#include "display.h" is for User Header files
That's basically it.
No more
[@"string1" stringByAppendingString:@"string2"];
or
[NSString stringWithFormat:@"string1%@", @"string1"];
just
@"string1" @"string2" @"stringN" -> code>@"string1string2stringN"</code
The Objective-C 2.0 Programming Language.pdf, p131
height: 20px
width: 20px
all styles
typedef enum {
UIActivityIndicatorViewStyleWhiteLarge,
UIActivityIndicatorViewStyleWhite,
UIActivityIndicatorViewStyleGray,
} UIActivityIndicatorViewStyle;
openFrameworks on iPhone, now finally public.
http://www.memo.tv/ofxiphone
http://www.jeffcrouse.info/uncategorized/openframeworks-on-iphone/
i shall attempt to install it, and report back then. in the meantime too busy with the wolf.
update:
installation was a breeze, the demos are running quite nicely. (of course you did not forget changing the code-signing in the target to your id). curious to find out what the hardware can do. and finally no more excuses of not getting into oF.
The granddaddy of the FPS at your fingertips.
http://www.idsoftware.com/wolfenstein3dclassic/
buy at app store - or download the source code for free!!!
(just change the code signing settings to your id. you should really know how to do this.)
[button setBackgroundImage:image forState:UIControlStateNormal];
[button setImage:overlay forState:UIControlStateHighlighted];
use one image as button background, another - preferrable at least paratly transparent - as overlay when highlighted.
viewDidLoad only if the view is unarchived from a nib, method is invoked after view is set.
loadView only invoked when the view proberty is nil. use when creating views programmatically. default: create a UIView object with no subviews.
- (void)loadView {
UIView *view = [[UIView alloc] initWithFrame:[UIScreen
mainScreen].applicationFrame];
[view setBackgroundColor:_color];
self.view = view;
[view release];
}
By implementing the loadView method, you hook into the default memory management behavior. If memory is low, a view controller may receive the didReceiveMemoryWarning message. The default implementation checks to see if the view is in use. If its view is not in the view hierarchy and the view controller implements the loadView method, its view is released. Later when the view is needed, the loadView method is invoked
again to create the view.
Specific example. Deselect table cell after a certain time. TableView and indexPath are wrapped into an array and send along to the method for delayed execution.
- (void)tableView:(UITableView )tView didSelectRowAtIndexPath:(NSIndexPath )indexPath {
NSLog(@"User selected row %d\n", [indexPath row] + 1);
// actions
[self performSelector:@selector(deselectTableCell:) withObject:[NSArray arrayWithObjects:tView, indexPath, nil] afterDelay:0.2f];
}
-(void) deselectTableCell:(NSArray *)array {
[[ [array objectAtIndex:0] cellForRowAtIndexPath:[array objectAtIndex:1] ] setSelected:NO];
NSLog(@"deselectTableCell" );
}
In additon to http://codec.trembl.org/35/
Does
+ (id)buttonWithType:(UIButtonType)buttonType
create an auto-released object? Seems very much like it.