I have set up an animation in Xcode using an NSTimer, and It kept repeating over and over, so i used this command:
else if(gordon.image == pigImage11)
[animationTimer invalidate];
So, when gordon (a UIImageView) image is set to pigImage11, The timer invalidates, this gave the desired effect of stopping the animation constantly rep...
I have an XML reader class which I initialize with a URL
- (id)initWithURL:(NSURL *)url
This class adds objects to an array in the calling class using an instance variable
// in the interface
ViewController *viewController;
// in the implementation
[viewController addObject:theObject];
Now, I initialize my XML reader class, then s...
I am interested in knowing whether I can expect the observing object's method to be pushed onto the stack before the posting object's method has been completed and removed.
...
I'm just starting to use multithreading and was looking for a good explanation. I'm not sure if there are differences in how multithreading works on Macs and iPhones. Does anyone have a good link to tutorials with example code?
Thanks.
...
How can I remove the first \n character from an NSString?
Edit: Just to clarify, what I would like to do is:
If the first line of the string contains a \n character, delete it else do nothing.
ie: If the string is like this:
@"\nhello, this is the first line\nthis is the second line"
and opposed to a string that does not contain a ...
I have made a short applescript that sends an email with an attached vcs-file. Now I want to integrate this script in my cocoa application. I have tried the following code that i found on the internet:
NSAppleScript *mailScript;
NSString *scriptString= [NSString stringWithFormat:@"the applescript"];
mailScript = [[NSAppleScript alloc] i...
i want to show 4 options(strings) randomly on uitableviewcell how do i achieve this???
...
AnalysisTool (a Clang GUI front end) states some fo my ivars are improperly named:
Specifically:
the name of instance variable
'groupName' doesn't start with the 'm'
prefix
What does the 'm' prefix stand for in Cocoa?
Should I be using it? Or is this a false positive.
...
I have a WebView displaying a HTML page, linking to a CSS file.
The CSS file makes use of the pseudoclasses :active and :hover for rollover effects.
Q. How can I tell, in my WebView, when :active and :hover have been called? I would like to intercept these calls and act on them programmatically within Cocoa.
Thanks.
...
I'm building an iPhone application where I detach some threads to do long-running work in the background so as not to hang the UI. I understand that threads need NSAutoreleasePool instances for memory management. What I'm not sure about is if the threaded method calls another method - does that method also need an NSAutoreleasePool?
Exa...
I'm using NSDate to get a string such as "18 Jun 09", with code:
NSDate *theDate = [NSDate date];
NSString *dateString = [theDate descriptionWithCalendarFormat:@"%d %b %y"
timeZone:nil
locale: nil];
This works, but only results in an English output. I need the output to be localized in the user's default language.
Doe...
I want to change my NSNumberformatter from displaying negative numbers with parenthesis around them to putting the minus sign in front (or whatever the localized standard is).
I would assume I could do this with setNegativeFormat:
but reading Apple's oh so thorough docs I am left scratching my head:
setNegativeFormat:
Sets the fo...
the following piece of code which gets successfully built and also seems alright to me but doesn't work... mind that i am new to key value coding and your help will be greatly appreciated...
in table view delegate didSelectRowAtIndexPath: method
here the categoriesList is a simple table with 5 entries
NSUInteger row = [indexPath row];
...
can we convert NSArray to c array. if not what alternatives are there.[suppose i need to feed the c array in opengl functions where the c array contains vertex pointer read from plist files]
...
Hi Everyone:
I am looking at using AquaticPrime for my key generator for a Cocoa shareware app. For those of you who don't know about it, you can check it out here: http://aquaticmac.com/. However, I am running into a problem when I attempt to implement it. I don't want my users to have to copy and paste a whole dictionary into my ap...
I'm trying my hand at the iPhone course from Stanford on iTunes U and I'm a bit confused about pointers. In the first assignment, I tried doing something like this
NSString *processName = [[NSProcessInfo processInfo] processName];
NSInteger *processID = [[NSProcessInfo processInfo] processIdentifier];
Which generated an error, after t...
I have an app that is being compiled with a minimum system requirement of Tiger (OS X 10.4), but I need to include some code to deal with Spaces if the app is executing on Leopard (OS X 10.5).
How do I do this?
(The call I need to make is to -[NSWindow setCollectionBehavior:]).
...
Our application is occasionally hanging while it saves, where the core data raw file is being left locked (perhaps by our spotlight importer). We've verified that it's at a low-level file level, not at the core data level.
What I'm trying to do is figure out how to monitor the application while it's running so if I get this hang, I can...
I am a beginner programmer in Objective-C. Can anyone please tell me how to perform call back functions in Objective-C.
I would just like to see some completed examples and I should understand it.
Thanks a lot
...
A button on my inferface, when held down, will perform a series of changes on other parts of my interface.
For instance, for one second some text will turn blue, then a UImageView will change its image for two secs ...etc etc...
This series of changes will keep looping thru the same steps as long as the button is held down.
I've neve...