objective-c

XCode 4 Generating classes from entities in CoreData

Hi guys, Im using XCode 4 and working with CoreData. Now, how do I generate classes for entities? I used to do it in XCode 3 by clicking on a diagram entity, going to File->New and choosing NSManagedObject class. For some reason i cant seem to find it in XCode 4, it's not showing up in the dialog... ...

How can I access all the objects of an NSDictionary?

I have an NSDictionary, with six objects, and the keys a, b, c... etc. What I am doing is removing three objects by their keys, and I don't know what objects are going to be removed, as they are determined by user input, so I could be left with a, d, and e. If this was an array, I could just access the ones left over by using objectAtInd...

Multiple Loop Variables in For Statement in Obj-C

Is there a way to have multiple loop variables in a for statement? Here would be a hypothetical representation of what I'm talking about: for (NSString *foo in bar; NSString *bob in example) {} If not what is a good way to accomplish this? Thanks, Kolin ...

Iphone multitouch handling

I'm writing an iPhone app, and I want to handle multitouches. I'm using cocos2d libs. So I've made a CCLayer subclass and set it to be a CCStandartTouchDelegate. For some reason I don't want to use UIGestureRecognizer and to build a correct logic I should know the answers for these questions: If I tap the screen with one finger, and th...

Approaching porting a (Java) library (to Objective-C): Methodology?

I am an iOS developer and I found a great library that handles all kinds of astronomy related calculations for me. The problem is that it's written in Java. Although I have enough experience with languages close to Java, I can't run Java on iOS. I'd like to port it, but being that I've never ported anything before. Like I said, I don't ...

Trigger on scheduled events

Hello all! I got an schedule in an plist-file, reading the events (read: times) is not the problem. The problem is comparing the events with the current time. I am somewhat new to iPhone-development so it might be an easy answer for this but here it goes: scheduleTime isEqualToString currentTime - well that does the trick almost... What ...

Image VIew problem

How can i remove an ImageView added on a dynamically created UIView, so that i can add another ImageView on my UIView. ...

Help with "Cannot perform operation without a managed object context"

I have an NSViewController with its own nib that requires access to the managedObjectContext to display objects in a tableview. This is how I have the managed object context set up in my view controller: @interface { ... NSManagedObjectContext* managedObjectContext; ... } @property (nonatomic, retain) NSManagedObjectContext...

How to create a static NSRange ?

Guys: It is really a stupid question, but I really don't know how to. I have a utility class and need to define some pre-defined variables. Here's how my class looks. #pragma mark File header part definiation (start offset, length) NSRange HEADER_VERSION = NSMakeRange(0, 4); /* 0,4 */ NSRange HEADER_IDENTIFIER = NSMakeRange(4, 18); /*...

How to send the pins in the map view back to the call out view?

Hi all, I am implementing MAPKit Based application, In that I had a problem with the pins display. Some times they are coming on top of the callOut view. I used the following code to send the pins back, - (void)mapView:(MKMapView *)mapView didAddAnnotationViews:(NSArray *)views { for (MKAnnotationView* annotationView in view...

Problems with overlaying different UIImages

Hi folks, accordingly to some UIColor values from within a scroll views context I want to change the pixels rgb values for several UIImages I want to overlay afterwards. At least I have 4 images I'd like to overlay, a background image which is static and 3 layer images whose pixels information I'd like to change before overlaying all tog...

get computer name on mac (objective-c)

How can i get the computer's name in objective-c on a mac. I'm talking about the same name as the one you can find in System Profiler under software. ...

Mismatched -init method names

I discovered an odd scenario that produces a compiler warning in XCode that I don't believe is a valid warning. As an example I created two classes, ClassA & ClassB, that both have an init method called -initWithSomething: One takes an (NSDate *) as the "something" and the other takes (NSString *) Class A // ClassA.h #import <Foundati...

Objective-C variable with multiple permissions

I have a data model which is similar to this: (in another project) ________________________________ _______________________ | | | | | Graph | | DetailedGraph | | GraphListener lstnr ...

How to add parameter in the addTarget's selector?

Say I have a function like this: -(void)activateDict:(NSNumber*)dictID{ } Then I add a action for my button: [aBtn addTarget:self action:@selector(activateDict) forControlEvents:UIControlEventTouchUpInside]; There is a parameter in the activateDict function, which is (NSNumber*)dictID, so when I add the action to button, how can ...

Custom UITableViewCell for Settings-like application?

I'd like to have a settings view in my app. I want to have things like UILabels, UISwitches etc. (Like in the Settings app.) How can I go about doing that? Can I just replace the detailView with the required view, or is there more to it then that? That may not work because I need to be able to set and get text values too. ...

Why should I ever use nonatomic in a property?

Possible Duplicate: Objective-C properties: atomic vs nonatomic By default all properties in Objective-C are atomic. If I need nonatomic I have to declare it. But I wonder why should I ever use nonatomic? Even if my applications are not multi threaded, atomic seems like the way to do it. What are the advantages of nonatomic? ...

Questions about using Accelerate.framework

Hey guys, I have some questions about the Accelerate.framework. I am trying to do some vector stuff. First of all what is the difference between Single Precision Float, Single-Precision Complex, Double-Precision Float, and Double-Precision Complex? And what should I be using for my own struct defined like float x; float y; float z; And ...

My timer isn't stopping my parsing

I want to put in a timeout in case it takes too long to find my location, send out the relevant url, and parse the xml. It worked when I used performSelector:withObject:afterDelay in the locationManager (just to test getting the xml), but when I put similar code around my parser it doesn't actually abort the parsing. I am testing this by...

When to release an instance variable

Basically I have this scenario going on: //in interface header @property(nonatomic,retain)OtherClass *otherClass; //implementation - (id)initWithOtherClassInstance:(OtherClass*)otherClass { if (self != [super init]) return self; self.otherClass = otherClass; return self; } - (void)dealloc { //Do I need...