objective-c

Objective-C Late Static Binding

I'm teaching myself Objective-C as a guilty pleasure, if you would. I have a self-proclaimed strong grasp of the Java language, so it's not a terribly difficult transition – it sure is fun though. But alas, my question! I'm attempting to reproduce something that exists in PHP: Late Static Binding. In PHP, I can decorate a method call w...

Retrieve a char from a char array

Does anyone know how to retrieve a char value from a char array: char* alphaChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; for (int rowIndex = 0; rowIndex < 12; rowIndex++) { char* text = (char*)alphaChars[0]; //this throws an error //CGContextShowTextAtPoint(context, 10, 15, text, strlen(text)); //This is where I wanna use it } ...

iphone: (audio) posting message to kill mediaserverd

Hi guys, i'm playing several sounds using AudioServices AudioServicesPlaySystemSound ( aSystemSoundID ); when i test the project on the iphone (3g) attached to the machine i got this message: 2010-09-16 17:29:29.672 myProject[6528:6def] [17:29:29.672 <0x85d400>] PlaySound posting message to kill mediaserverd (5958) [Swi...

Removing data from plist file with uitableview

Hi all, I have a plist file that is brought into a tableview, and now want to remove items that I have added in the past, but don't even know where to start. I have got the editing working, well it shows on each line, any help more than welcome on this! - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSIntege...

iOS UITapGestureRecognizer doing nothing at all?

Very strange. I have implemented a number of swipe gesture recognizers, all working fine. I just added a tap gesture recognizer, though, and when I run the simulator and click I get no effect. In the following code, [self doMethod] will never fire. I set up all the gesture recognizers in viewDidLoad for my controller. I am using a UIWebV...

Objective-C Testing Frameworks

Are there any tools or plugins for XCode that can generate test cases for your apps? ...

Impossible issue connecting to Windows Live Messenger network

This issue is giving me serious headaches, I don't have a clue what's going on here. If you don't have any experience with the Windows Live network, I ask you to read this anyway, maybe it has nothing to do with it and am I overlooking something totally unrelated. In short: I wrote an Objective-C class that allows me to connect to the W...

What is the simplest way to know that NSManagedObject instance is new and hasn't been persisted yet?

I,ve found IsInserted property, but what if I created object without inserting it into managed context? Maybe I can use ObjectID somehow for such a purpose? ...

Timer interval with 2 NSDateComponent

Hi, I have two nsdatecomponent object, and I want a substract the time of my first object with the time of the seconde object. example: DateComponentObject1 = DateComponentObject1 - DateComponentObject2 so, if I have 3 hour in DateComponentObject1 and 1 hour in DateComponentObject2, I have 2 hour at the end in the DateComponentObject1...

Mixing C++ and Objective-C (Suspected Automake problem)

So, I've been working for some time on connecting hashing out a trivial application, comprising C++ and Objective-C, to prove some concepts and try and learn something. Here's where I'm at now, my command (being run, and re-run on changes) is $ autoreconf -vis && make clean && ./configure && make && ./src/greetings Note, that I'm h...

360° panorama librarys for ios

are there any libraries or classes out there to show a 360 degree panorama on the iphone? i found this here: http://code.google.com/p/panoramagl/ but its not up to date and only for old versions of ios. i'm thankfull for any link that helps me to create a 360 degree panorama view on ios. thanks! ...

2 subview to window?

hi, i have this at my appdelegate: for 1st app: - (void)applicationDidFinishLaunching:(UIApplication *)application { [window addSubview:rootController.view]; [window makeKeyAndVisible]; } this will display a navigation and tabar display for my app. ok no problem here. next i have this from another app: - (void)...

iPhone: is YAJL accepted for usage by the AppStore?

Does anyone know if using YAJL for JSON parsing on iOS is accepted by the AppStore? ...

Having trouble compiling Three20 sample TTCatalog

I downloaded from git a copy of the latest three20, and I keep running into errors when I try to compile the sample code in the folder. Undefined symbols: "_UIApplicationDidEnterBackgroundNotification", referenced from: _UIApplicationDidEnterBackgroundNotification$non_lazy_ptr in libThree20UINavigator.a(TTBaseNavigator.o) (...

What is with Objective C Nib Files?

Do Nib files automatically initialize certain properties? In most objective-c code I've seen, you initialize a pointer with: MyObject* obj = [MyObject alloc]; [MyObject doStuff]; [obj release]; However, with certain objects (like ViewController Subclasses) UIView objects are used without being initialized, and aren't ever released. D...

Odd behavior with NSUInteger - can't convert to float properly

Here is my situation. Its driving me nuts: I have an NSMutableArray with a count value of 517. I have a double value that is my multiplier. double multiplier = 0.1223; double result = [myArray count] * multiplier; // 63 even (wrong!) In fact it should be 63.2291. If I go: double result = [myArray count] * 0.1223; // 63.2291 (right!)...

What setup is required to draw a UIImage?

At the moment i have declared my UIImage. I load in an image into it. But when I call the draw method I see nothing appear on the screen. Trying to get a little clock image to appear on my View. clockImage = [ UIImage imageWithContentsOfFile:@"clock.png"]; [clockImage drawAtPoint:(CGPointMake(300.0, 300.0))]; Am i missing some vital...

Anyone have an example of how to write audio and video simultaneously using AVAssetWriter?

Been trying to figure this out with zero success. I can write video output no problem ... but once I try to introduce a second AVAssetWriterInput to include audio the final quicktime movie is jumpy with frames being loss left and right and audio constantly going in and out. Thanks - wg ...

When should I use a UIViewController in IOS Programming?

I've been looking at the API for IOS Programming, and have been reading about view controllers and UIViews. It looks like UIViewController subclasses are really useful for Modal navigation and custom animation, but I can't see any other uses than that. What is the benefit to using a UIViewController subclasses rather than a normal NSObj...

Objective-c: Objects by value / Structs with methods / How can I get something like that?

I'm starting to code in objective-c and I've just realized that objects can only be passed by reference. What if I need an object to use static memory by default and to be copied instead of referenced? For example, I have an object Color with 3 int components r, g and b. I dont want these objects to be in dynamic memory and referenced ...