Does it matter if I call the method of the super class first thing or at the end? For example
-(void)didReceiveMemoryWarning {
/* do a bunch of stuff */
[super didReceiveMemoryWarning];
}
versus
-(void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
/* do a bunch of stuff */
}
same question for other method...
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've built a screensaver for Leopard which utilises core-animation. It doesn't do anything overly complicated; uses a tree of CALayers and CATextLayers to produce a "table" of data in the following structure:
- root
› maincontainer
› subcontainer
› row [multiple]
› cell [multiple]
› text layer
At most the...
i want to show 4 options(strings) randomly on uitableviewcell how do i achieve this???
...
I'm just starting to learn programming. And as of now, I know a tad bit of memory management in Objective-C. It wasn't easy learning it.
So, just out of curiosity, is the memory management employed in major languages like C, C++, Java, etc., in any way similar to what I've learned?
...
I have a UITableViewController subclass with sections. The sections are showing with the default style (no rounded corners). How can I set the TableView style to grouped in the code? I'm not using Interface Builder for this, so I need something like
[self.tableView setGroupedStyle]
I searched on Stack Overflow, but couldn't come up wi...
Okay, just for starters, I am very new to Objective-C, (C in general). I am not new to programming, and I've found the transition seamless so far, until now. I'm trying to implement a Sprite class I found online in order to develop a game on the iPhone, but I'm getting many errors. For example...
size = CGSizeMake([image size].width , [...
Hi everyone,
i am new Mac and iphone SDK.
i writing basicly a game application. and i want to update and show game score using SQLite.
i searched in web for my problem but i didnt find any solution for me.
error is:
Ld /Users/Iphone/Desktop/IDRGame/build/Debug-iphonesimulator/IDRGame.app/IDRGame normal i386
cd /Users/Iphone/Desktop/ID...
I have several years of experience in Obj-c and Cocoa, but am just now getting back into it and the advances of Obj-C 2.0 etc.
I'm trying to get my head around the modern runtime and declaring properties, etc. One thing that confuses me a bit is the ability in the modern runtime to have the iVars created implicitly. And of course this i...
I have a Cell with lots of Labels and a Button.
I want to make cell's color blue and make only the button selectable, not the cell.
The button should have its own color.
How can I do this using with xCode and the IPhone SDK?
...
I am a new Objective-C programmer coming from a C#, VB.NET, Etc. These are all garbage collected languages and for the most part the worst thing you can do is abuse memory usage, because when your program shuts down the memory is reclaimed by the runtime.
However, I am not clear about Objective-C. I get that for the most part its up to ...
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 UIViewController subclass that is acting as the delegate for a UITextView. I implemented textViewDidBeginEditing to display a 'Done' button to dismiss the text view... all is well... except that when the text view has text and is not in edit mode, if a user holds a finger in the text view causing the text to be zoomed with the ...
In Objective C, is there a one-liner or something small to remove (shorten by one) and return the first element of an array, regardless of its index?
...
I have a UIScrollView with nested UIImageViews. Each imageview can zoom, but when I try to scroll the inner scrollview while zoomed on the image, the outer scrollview picks it up and switches imageviews.
How can I prevent this from happening so that the outer scrollview only scrolls when the inner is not zoomed?
...
Are these basically the same thing?
For example if I have an interface in Java
public interface CoolObject{
...
}
I can use any object that implements the CoolObject interface in functions that take a CoolObject as a parameter:
public void foo(CoolObject o) {
...
}
Is this the same in Objective-C?
@protocol CoolProtocol
...
@en...
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've found references online that talk about two different root classes for ObjC, either objc/Object.h or Foundation/NSObject.h. They require different compiler flags (-lobj vs. -lobjc -framework Foundation, and have different selectors for initializing & releasing objects. Is NSObject a replacement, or do they have different application...
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];
...
I'm currently experimenting with writing an iPhone app and am having some trouble with understanding how to exit an app properly.
Basically, I have a view controller that is displaying a table of data to the user. At the same time, when the application launches, it spins a new thread to retrieve data from the server and update the tabl...