I have a selector and target, and calls the method like this
[target performSelectorOnMainThread:(SEL)selector withObject:nil waitUntilDone:FALSE];
But after I changed it to this, it doesn't work
[target performSelector:(SEL)selector withObject:nil afterDelay:0];
Any ideas?
I don't want to perform that task on the main thread beca...
In Objective-C, I have a category for a class:
@interface UILabel(CustomInit)
- (id)initWithCoder:(NSCoder *)coder;
@end
What I'm doing is writing a custom init function that does some extra stuff, and what I'd like to do, is in this custom init function, call the UILabel's base initWithCoder. Is this possible? How so?
EDIT
Thanks...
so here's the abridged code:
- (void)viewDidLoad {
[super viewDidLoad];
currentLocation = [[UITextField alloc] init];
currentLocation.delegate = self;
........
}
-(void) setState:(NSString *)state andCity: (NSString *)city {
//currentLocation.text = [NSString stringWithFormat:@"%@, %@",st...
I got the following crash report from iTunesconnect. Is the UIActivityIndicatorView bugged?
Date/Time: 2009-09-26 12:33:02.034 +1000
OS Version: iPhone OS 3.0 (7A341)
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x00000000, 0x00000000
Crashed Thread: 0
Thread 0 Crashed:
0 libSystem.B.dylib ...
I'm new to the world of game programming but wanted to build a simple physics-based game for the iPhone. Does anyone know of any tutorials for Cocos2D and/or Box2D on the iPhone? The documentation is kind of confusing.
...
Kinda new to iPhone programming and was experimenting with threads
- (void)viewDidLoad {
[super viewDidLoad];
[NSThread detachNewThreadSelector:@selector(changeMain) toTarget:self withObject:nil];
[NSThread detachNewThreadSelector:@selector(changeThread) toTarget:self withObject:nil];
}
- (void)changeMain{
NSAutoreleas...
Hello,
I have a "didSelectRowAtIndexPath" action that adds a navigation bar and displays a new view. There's an action in the new view that pushes another view onto the navigation stack, and it works, but clicking "back" doesn't restore the previous view.
The sequence is basically:
user clicks table cell
Navigation bar appears, with...
I was trying to add cocos template for game development.
I was trying some R & D.
R & D was " How to add template of COCOS in x code ? "
But By mistake I made Some horrible changes to " My Seniors Sir's Mac ".
I am in very much tension.
How to reset?
I have replace all the previous templates.
Now I don't know How to reset it.
See...
Hi,
Here is the code I have:
Phone SDK undestanding cocoa object live cycle:
- (void) DismissWelcomeMessage: (UIAlertView *) view
{
[view dismissWithClickedButtonIndex:0 animated:YES];
}
- (void) ShowWelcomeMessage
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Blah" message:@"Blah Blah" delegate:self cancelButt...
When you take photos with the iPhone camera, they are automatically geo-tagged.
I have written the following code to take photos in my GPS Recorder app, but the photos are not being geo-tagged.
What am I doing wrong? Should I be using a completely different method, or is there some way I can modify my code to add the geo-tag and other...
The title says it all.
I have a receipt of a recorded transaction stored by the application when the transaction was done and I would like to ask apple's servers if this receipt is valid.
Is there a way to do this without using an external server?
thanks for any help.
...
I'm pushing a tableview in a navigation based app. The pushing view (viewOld) and pushed view (viewNew) are both UITableViewControllers. I have given viewNew a title from viewOld. Once viewNew appears, I see the title but no back button on the left. Shouldn't a back button appear once you give the view (viewNew) its title?
I can click...
Anybody know if there's a way to access iTunes from an iphone native program? Is there an sdk for that? i.e. - is there a way I can write a native iphone program and put in a 'buy' button that will bring up iTunes and go to some artist's song? Or better yet, just buy it right away?
...
I am trying to expose the pathForResource functionality to C++ from objective-c.
However, I am very new to objective-c and have not been able to discern how to use a c string as an argument in objective-c. clearly I have the wrong idea here.
how do i get pathForResource to use c strings as an argument?
here is my function:
static...
Hi Folks,
I've got an NSMutableArray that holds a bunch of objects, what I'm trying to figure out is how much memory is the array using. After looking at a couple of places I know about the sizeof call, and when I make it I get 32 bits (which is the size of the NSMutableArray object it self).
Example code:
NSMutableArray *temp = [[NSM...
In a Cocoa-Touch iPhone app, I get this error if I add a class named List to my Xcode project:
objc[25878]: Class List is implemented
in both /usr/lib/libobjc.A.dylib and
/Users/steve/Library/Application
Support/iPhone
Simulator/User/Applications/4883BE28-51DA-493C-9D8A-28FD026708F4/Duplicate Classes Test.app/Duplicate Classe...
Hi,
how would you go about saving a state in a tableview-drilldown, when using core data? So next time you start the app, the drill down level you where at when you exit the app will be loaded in.
I looked at apples drilldownsave sample code, but couldn't figure our how to change to code to work with core data.
Any help would be ve...
If i try to use this simple code:
- (void)applicationDidFinishLaunching:(UIApplication *)application {
// Add the tab bar controller's current view as a subview of the window
[window addSubview:tabBarController.view];
NSString *stringMer = [NSString stringWithFormat:@"OK COOL"] ;
NSString *stringMer2 = [NSString stringW...
I am trying to geo-tag photos taken with the iPhone camera. Since I'm not saving the photos to the camera roll, the photos do not have any EXIF data.
So, what elements are required in valid EXIF data? I think I have written the latitude, longitude, and altitude to the EXIF data, but when I export the photo, there doesn't seem to be any ...
The application will stop responding to any touch events after clicking on either button. (Controller#increase / Controller#decrease methods).
Here is the output of the console on startup
[Session started at 2009-10-04 14:41:20 +0300.]
GNU gdb 6.3.50-20050815 (Apple version gdb-1344) (Fri Jul 3 01:19:56 UTC 2009)
Copyright 2004 Free S...