objective-c

Core Data: Sort to-many relationship in NSTableView

Hello experts, I have troubles getting my NSTableView keep the contents of a to-many relationship ordered. What I have is an entity "Relationship" in a to-many relationship with an entity "Card" both managed by an NSArrayController. Card has 2 attributes, "number" (int) and "name" (String) displayed via Bindings in two columns of a NS...

How to save values of NSUserDefault in array,and how to retrieve and POST

I hav to save the values of NSUserDefault to the Array,and later on have to POST the values bu usind HTTP POST, m trying this code,its working perfactly (when i reopen my application values reappear on the screen)but when i input tte values....it displays userneme=null,database=null.....)what should i have to do.should i have to save N...

How to check whether a music is playing or paused in AudioQueue

Hi, I am using AudioQueueStart for playing music and AudioQueuePause for pausing. Is there any way in AudioQueues to check whether the music is playing or not, I want to Pause music only if it is playing. ...

How to get view old version Apple's Example code ?

Hi Fellows, I was wondering , is it possible to download old version of IPhone SDK samples .....? Why because i can see IOS SDK 4.0.1 versions. and that's not executing in IOS sdk 3.1.2 ... If there is a way please tell me ? thanks in advance and waiting for reply, jenie ...

How do I round a NSNumber to zero decimal spaces

How do I round an NSNumber to zero decimal spaces, in the following line it seems to keep the decimal spaces: NSNumber holidayNightCount = [NSNumber numberWithDouble:sHolidayDuration.value]; ...

how to renew subviews?

Hello, I want to renew a subview which is created like this: CGRect keyLabelRect = CGRectMake(2, [heightofrow intValue]*i, [breitescroller2 intValue]-2,[heightofrow intValue]); UILabel *keyLabel = [[UILabel alloc] initWithFrame:keyLabelRect]; [Inhalt1 addSubview: keyLabel]; [keyLabel release]; By calling a method, "breitescroller2" g...

iPhone Task Completion

I started a few days ago to experiment development for the iPhone platform, and while reading about it's multi-tasking capabilities I found out the "task completion", which can be very useful. I googled a little, read the documentation available at developer.apple.com/iphone, but still haven't found something: is there a way to have th...

Cocos2d:Add uilabel in scene

Hi, I draw a cocos2d scene in window and now want to add a label on top of the scene... Any idea?? Thanks ...

What is the ideal way in the iPhone SDK to handle data coming from a web service?

Currently, we're using ASP.NET asmx web services to interface with our iPhone application. My question is; whats the most ideal way of converting the responses from the services into objects which are easy to manage in Obj-C. At present, we have defined a class which has all the methods in it (GetSomethingById), this then converts the ...

Xcode plist files consistently forget type designations

I have numerous Plist files that contains dictionaries in a project and I find that they reliably forget the data type of various entries and default to NSString. For example, I might have a PLIST containing a dictionary with several keys set to a type of NSNumber, and after closing and reopening Xcode they all get defaulted to NSString...

Refresh/reload view after syncing on the Internet

Hi all, I'm writing iPhone application which periodically is syncing with the synchronization web service. Everything works ok, but unfortunately after synchronization user do not see any changes in the view if he visited it before. I need to force to reload/refresh some of views. How could I do that with for example viewWillAppear met...

Import Header-File depending on the target name in Xcode

I have a preprocessor constant called TARGET_NAME holding the current target name. I want to import a certain header file depending on the target name, e.g. include "App-Config.h" when TARGET_NAME is set to App-Config. How am I going to achieve this? ...

scheduling task in iphone

Hi all, I am developing an iphone app, there's a section in it where user can declare his task and its occurence in time. I.e. recursive task. The task will only show an alert box and nothing else when its due time. Its a kind of reminder, rather than a real task scheduler. What's the best way or technology to achieve that with objecti...

Handle Ongoing UIView-Animation during Device Rotation

I've got quite a few UIView-based Animations going on most of the time in my app. I want to be able to handle all device rotations, but it's always a performance hit when you trigger the device rotation when there's already an animation going on. I wonder what's the best practice for cases like this? Shall I subclass all my UIView elem...

How to save array to NSUserDefaults?

I would like to save an array of view controllers in NSUserDefaults, but I am not sure how: [[NSUserDefaults standardUserDefaults] setObject:tabBarController.viewControllers forKey:@"tabOrder"]; When I read the above line, my tabBarController.viewControllers is blank. ...

New to Objective-C --> Quick question(s)

So I'm trying to make the horrible leap from VB.NET to objective-C. My only curly-brace experience is a little ActionScript 3... I'm having a hard time grasping the use of the * character. Question 1: The tutorial I'm using has these two lines next to each other.. IBOutlet UIPickerView *pickerView; NSArray* myArray; It's my unders...

Core Data: To-Many Relationship ordered upon restart

When I restart my Core Data application with a to-many relationship my data (presented in NSTableView) is in random order. How do I keep it in that order in which the user left it before quitting the application? Of course, I can sort the data in awakeFromNib but that does not give me the precise order the user used to arrange the data ...

How to set up a class two steps down?

I'm getting a little confused how to set up a class that's two steps below the top-most one. For instance, say I have a game called BoardGame. One of whose parameters in numberOfSquares. The classes are setup like this: BoardGameSetupViewController > BoardGamePlayViewController > GameEngine BoardGameSetupViewController creates an ins...

get just the month, day or year part of NSDate?

Say I have the following: NSDate *today = [NSDate date]; How do I just the get integer value for the month? day? or year? ...

Class method does not invoke on iPhone

Hi, I wrote a small class containing 2 class methods for some calculations. I call those methods from another class. I have declared everything properly in both classes and Xcode does not give any warnings. Still, I checked with debugger and when I call method from this class it just doesn't invoke THis is declaration: +(double)Double...