objective-c

Core Data set Attributes

Hi there, I'm trying to set attributes with Core Data but it won't work. Every time I call the mehtod setAveScore it throws the error [Stats setAveScore:]: unrecognized selector sent to instance 0x3364c0 Any idea what is going wrong? The call: Stats *sObj = [Stats alloc]; NSNumber *foo = [[NSNumber alloc ]initWithInt:1]; sObj.aveScor...

Deleting breakpoints in Xcode

There are some breakpoints in my project that for some reason can not be turned off or deleted. How can I delete these? I heard that they can be deleted by deleting a file with the extension .dsk, but I can't find that file. Where is it? ...

NSString does not have to be released in cellForRowAtIndexPath: method?

In order to set cell.textLabel.text in the cellForRowAtIndexPath method I alloc and init a string. If I release this string after setting cell.textLabel.text, then the program will crash after doing this several times. Why doesn't it crash the first time? Since the string was alloced and inited, doesn't it have to be released? Here's t...

How to find out if the back-button was tapped in the UINavigationBar?

Firstly I have tried to manage it with the viewWillDisapper-method, but this not detailed enough for me. Is their an other solution? Also tried the delegate: - (void)navigationBar:(UINavigationBar *)navigationBar didPushItem:(UINavigationItem *)item but nothing happens. ...

How to detect CPU speed and H.D.D rpm in objective-c or python

I'm new to objective-c, for an academic reason I need to read CPU speed and H.D.D rpm What is the simplest way to access some system setting in objective-c or python I can choose between objective-c and python for this project, so any help will appriciate ...

How to test 2 NSString to see if they're the same?

So I want to test 2 NSString to see if they're the same while I'm typing so like: NSString *theOriginalString = [NSString stringWithFormat:@"Superman"]; NSString *theTypedString = [textView string]; I want to see if theTypedString is wrong while I type it out so a warning pops out if someone typed the wrong answer. Thank you in adv...

Core Data with json

This question is a follow up on this question. I am using the JSON Library found at http://code.google.com/p/json-framework/. My Core Data object model has a many-to-many relationship to itself and as such, has a set for its sub object. In JSON, the set is represented through an array of object ids. Nothing really exotic. When I am c...

How to get seconds elapsed from a Date String?

In objective-C, I want to determine the seconds elapsed from a date string such as: "Sat, 09 Oct 2010 06:14:50 +0000" How do I do this? I got lost in the convoluted descriptions of NSDateFormatter. ...

Modifiying an object outside of a NSArray

In Class Foo I have a retained property of an NSArray which holds UIViews (which have backgroundColor properties) In an instance of class Bar I set the NSArray to an array of views, and then set a views background color: [viewOne setBackgroundColor:[UIColor blueColor]]; NSArray *tempArray = [[NSArray alloc] initWithObjects:viewOne, vie...

iphone: creating the 'blue bubble contacts' effect in ComposeEmail?

Hi, I want to create an effect similar to the 'blue bubble tag' effect in the Compose Email Page where the recipients email address appears. I need to design a similar effect to allow users to create 'tags' for a picture.. Do I have to use Core Animation for this? Can someone please give me some pointers on where / what i need to use? ...

iPhone: NSDate convert GMT to local time

I currently have an API call returning me a date/time in the format: "2010-10-10T07:54:01.878926" ..Can I assume this is GMT? I also converted this to an NSDate object. Is there a way to use the local iPhone time to recalculate the time? ...

Runtime method argument type information in Objective-C

I want to fetch information about the types of the arguments in an instance-method at runtime. For instance if I have the method: - (void)doSomethingWithItem:(Item *)item usingName:(id<Type2>)name; Here I would like to retrieve Item and id<Type2>. Is there any way of doing this, or is there no type information available for the argu...

how to send data from iphone over wifi to application, to print message

hi, i would like to know how to do the following: step 1: how to send the following string from the iphone to a mac computer via WIFI when a user presses a button. string to be sent: "hello". step2: how to receive that string with an application i would have to create. it will be very simple. it will have no interface, except it will ...

Accessing an object outside scope in a controller class

In my controller class, I initialize two instances of a model class (whose header is properly imported into controller class) with an NSButton. The model is really simple, just 4 members and one method - attack(). Making a silly text game! - (IBAction)startGame:(id)sender { Combatant *hero = [[Combatant alloc] init]; Combatant...

ModalViewController based app crashes after 30 presentations

I have an ipad App, which has categories (tableviewcontrollers inside it) and detail views which has a webview shows info of the row on tableview. On didSelectRowAtIndexPath function of category table views i am using the code as: DetayViewController *dvc = [[DetayViewController alloc] init]; Blog *b = (Blog *)[self.blogArray objectAtI...

XCODE debugger, I don't get this

Hello there - I am trying to understand how to accomplish some basic debugging stuff with gdb I want to check the length of this control (UILabel) if I type the following in the console I get nothing, what's the proper way to do it? (gdb) po self.mylabel.frame.size.width There is no member named frame. or if I try without self: (gdb...

create hardware for iphone to connect with external device. arduino?

hi i need to create a simple connector. I think i may need to create an arduino board that will take data from the application and then transmit them to an external device. There is a slider in the application which the user can adjust. When adjusting the slider the application will just send in values from the application to the connec...

Subclass UIView or UIViewController

I want to make a "section" which has an image and some text below it. Should I be subclassing UIView or UIViewController? I'm thinking UIView as it won't know what image or what text to display, just that there will be both. Also if it is UIView, what method do I add the subviews (UIImageView and UILabel) in as subviews? Or should I dra...

Access to NSArray from 3 different instances of class

I have 3 different instances of a class and when a user taps a button (there are buttons for each of the instances) I want it to add the text of the button to the NSArray. But the NSArray must contain all 3 different sets of "historys" Should I be using a singleton, or just keep a reference to the NSArray as a property? ...

clipping an image objective-c

I created a Grid of Images. The frames of those images are squares-shaped(CGRects). Unfortunately the images fill-fits the square unproportionally. But I would like to "crop" or "mask" the given image. Which means my frames will show only parts of an image but proportionally correct. I tried contentModes of UIImageView but no luck. for(...