I am creating an application and I get an EXC_BAD_ACCESS error.
CODE
@interface DNProjectsCategory : DNCategory {
NSArray *projects;
}
@property(nonatomic, retain) NSArray *projects;
@end
And:
@implementation DNProjectsCategory
@synthesize projects;
// MEM
- (void)dealloc {
[projects release];
[super dealloc];
}
// INI...
I am using NSNumberFormatter to create a currency formatted string.
Everything works fine on most devices, but on some devices for example devices with Korean language, the $ sign shows up as a rectangle.
NSNumberFormatter *currencyStyle = [[NSNumberFormatter alloc] init];
[currencyStyle setFormatterBehavior:NSNumberFormatterBehavior10_...
Hi, I was trying to restrict the scope of a NSMetadataQuery item. I know there's the -setSearchScope method, but it lets me only decide in which directories the item will search. What if I need to exclude one or more directories from the scope?
...
Hi guys,
I know that it's trivial to add a red number badge to an app's icon on the home screen. What's the best way to get a badge that looks like this within my app? There are some classes I've found online that can do this, such as MKNumberBadgeView, but none that I've found look completely right. Facebook, for example, implements re...
Hi!
I have an UIView and its subview. When I animate myView (size.x+20) my subview is being animated too, however I want to translate my subview at the same time independently(origin.x-40) (without the subview moving because of the resizing of myView).
I was able to do it by adjusting the translations (or better position, because I mig...
In this part of my code I get a warning message saying it doesn't implement the custom protocol I made.
detailViewController.delegate = self;
How do I implement the protocol?
Then when I run the program it crashes saying
'-[DetailViewController setDelegate:]: unrecognized selector sent to instance 0x6a1c450'
...
I've probably overlooked something simple, but I can't figure out how to convert a specific date format in Objective-C. I'm receiving dates in this format:
Sun, 10 Oct 2010 01:44:00 +0000
And I need to convert it to a long format with no time, like this:
October 10, 2010
I've tried using NSDateFormatter, but when I try to get a date ...
So, I want to put an instance variable into a NSString like this:
NSString *theAnswer = (@"The answer is %@\n", self.answer);
I'm not sure am I right or not. I thought that NSString would work like NSLog but apparently it doesn't.
theAnswer returns as only the instance variable without "The answer is"
Can someone tell me why and h...
If I knew how to phrase this I could probably find the answer on Google. I need an XML parser which I can call out to other XML parsers with.
For example:
<car>
<driver>
<name />
<age />
<height />
</driver>
<make>
<name />
<nationality />
<age />
</make>
<engine>
...
I am wondering what differences such as disadvantages and/or advantages there are to declaring an NSString this way:
NSString *noInit = [NSString stringWithFormat:@"lolcatz %d", i];
as opposed to:
NSString *withInit = [[NSString alloc] initWithFormat:@"Hai %d", i];
What was the motivation of putting stringWithFormat instead of just...
How do you log the user in, create and store the user's session?
(It will timeout on its own aswell? do you need to store it in a database?)
...
Hi,
I am a newbie, writing a simple program and while there are no warnings/errors during compilation. I am getting a "EXC_BAD_ACCESS" error. Will appreciate any help with this:
int main (int argc, const char * argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
moviedatabase *movie1=[[moviedatab...
Hi, I would like to ignore all case sensitivity to be ignored for my UITextField and UITextView. I would also like to know how to detect if the string is upperCase or lowerCase. Thanks.
...
I have several custom UITableViewCell, which share a lot of common subelements.
I tried creating a UIView and using it as a subview for all the table cells, but obviously this wouldn't work, since entities in IB are object instances, not classes or templates.
How can I capture these common subelements in a custom control and drag it i...
How to call the tap on the back-button in the UINavigationBar programmatically?
...
A problem happens when I was trying to release one of my instance variables and reassign it a new value.
I would like to release the address that a instance variable points to, and re-assign a new value to it.
The code look like this:
The .h
@interface MapPageController : UIViewController<MKMapViewDelegate> {
AddressAnnotationManager...
I'm toying with a small game on my iPad using cocos2d and I've run into some performance worries. I have a 512x512 image tiled as my background. That gives me around 40fps with 20 sprites (in a CCSpriteBatchNode), the code for the background is this:
CCSprite *background;
background = [CCSprite spriteWithFile:@"oak.png" rect : CGRectMa...
Does anyone know if it is possible to replace the grey border on grouped table view cells
The opposite to this post: http://stackoverflow.com/questions/1408126/changing-border-color-in-iphone-uitableview-cells-non-grouped
...
Hi,
I have a problem. I want to subtract a date from currect date example:
Result = Today - MySpeficied Date
Can any one help me with a code snippet?
Many Thanks.
Best Regards,
Naveed Butt
...
Hi Friends. I have a simple question. How can I search NSMutable Dictionary?
For eg. I have a dictionary like this:
A1: Apple
B1: Banana
C1: Cat
D1: Dog
A2: Aeroplane
B2: Bottle
A3: Android
Now i want to search all the content (values) whose key starting with letter "A", means I want to sear...