objective-c

NSWindow created in IB won't show modally in the application

Hi, I have an application that when pressing a button it should show a modal window. I have some questions about it but I'm going to narrow it to what it's giving me a headache. I want to add that I'm already doing something alike that when applied to this particularly case won't work. What I already do is to show modally a NSOpenPan...

UIPanGestureRecognizer on a view inside of a scroll view works only sporadically when scroll view is zoomed in far

I have a UIPanGestureRecognizer on a view inside of a UIScrollView. Its function is to move its parent view around when panned. This works perfectly well at 1x and 2x zoom resolutions in the scroll view, but zooming in farther causes them to fail quite often - yet not always. There is also a long press & double tap recognizer on the sam...

need a Saple JSON parser in objective c

I want to know to parse a json object in objective c... i get the json object by loading a url.... can u please tell me how to do it or any samples or any reference.... the following is the sample json... {"name":"WFNX","now": {"id":"17749528","song":"Back Down South","artist":"Kings Of Leon"}, "desc":"101.7 - True Alternative",...

progress of AVAssetWriter

How can I calculate the progress of an AVAssetWriter process? So if I have something like: [assetWriterInput requestMediaDataWhenReadyOnQueue:queue usingBlock:^{ while (1){ if ([assetWriterInput isReadyForMoreMediaData]) { CMSampleBufferRef sampleBuffer = [audioMixOutput copyNextSampleBuffer]; if (sampleBuffer) { ...

Objective C duplicate method signatures

Having just spent ages debugging this, I'm keen to understand what exactly is going on! In a very contrived example, let's say we have two objects, Object1 has this method: - (void) testMethod:(NSString *)testString Object 2 has this method: - (void) testMethod:(NSArray *)testArray Then, back in Object1, there's the following code...

Programmatically added button crashing the app.

When i press my button the app crashes. Happens even when I create the button programmatically or try and add one through the XIB for the class where I need the button. I enabled Zombies and the debug msg I get from the console is : 2010-10-27 00:47:28.643 CarTrawler[1537:207] * -[ReceiptView performSelector:withObject:withObject:]: me...

NSTimer crash with EXC_BAD_ACCESS in shared class

Hi, I have an NSTimer running in a shared class. + (GlobalClass *)sharedInstance; Basically it runs once, and the second time it runs, it just killed the whole app. This is how I'm doing the NSTimer myTimer = [NSTimer scheduledTimerWithTimeInterval:5.0 target:self ...

Problem adding an image to the toolbar using UIBarButtonItem, displaying blank white box instead of image.

Im not sure what im doing wrong. The file name is correct, the style is set to plain. But Im getting a bank white box the size of my image. Im using UINavigationController. Please assist and thank you thank you in advance. **FYI I am sorta new to objective c so dont be too hard on me. ;) UIBarButtonItem *toolbarChannelGuideButton ...

Linking like in XCode's Interface Builder

Hello! I want to create a functionality in a program to link two views (inside another view) using links like when CTRL+Dragging in Interface Builder. In the implementation I have currently, there are 2 (or more) subclassed NSControllers (called Nodes) and inside those nodes there are 1 (or more) subclassed NSControllers (called Outlets...

Purpose of "nil' at the end of Initializing Array in Objective-C

I have seen and done initialization of arrays and all put "nil" at the end of initialization but never question, why it is required to put there? Plus if you are initializing your array in a loop, is it still necessary to put nil at the end of array? for example. array = [[NSMutableArray alloc] init]; for (int i = 0 ; i < 10; i++) { ...

Table cells delete wrongly

I have an app set up to have a tableview, which allows the user to add and delete cells (which are events). Adding and deleting DOES work, however when I delete a cell (by entering edit mode), I can click the (-) button to delete, then I hit the delete button, however the delete button stays highlighted and the cell does not disappear un...

Getting more information when an Objective-C exception is raised due to assertion failure

I'm getting an assertion failure from a UIKit function in my iPhone app. The error message looks a bit like this: 2010-10-27 02:31:49.058 MyProgram[114:207] *** Assertion failure in <some random UIKit function>, <location in UIKit source code> The exact error isn't really important, but my problem is just that the message is a bit shor...

Is there a better way write this objective-c code?

Hi, this code creates a random transition when I change scenes. There are eleven transitions. Because they are static, I think I cannot use NSClassFromString. I also need to pass the scene (s) object. Right now the switch seems redundant. Is there a way to rewrite this to make it more efficient? -(void) newScene { CCScene *s = [CCScene ...

Getting notified when the network connection changes in a Cocoa / Obj-C application

Is there any way to be notified / have your Cocoa application listen for changes in the network connection (disconnect, connect, etc.)? How does something like HardwareGrowler do it? ...

How to send an Array of NSString use NSURLRequest?

I have an Array of 5 NSString. I want to send my array to my web use NSURLRequest as URL query data? Anybody can help me :) ...

NSString Decoding Problem

This String is base64 encoded string: NSString *string=@"ë§ë ë¼ì´"; This is not show the orginal string: NSLog(@"String is %@",[string cStringUsingEncoding:NSMacOSRomanStringEncoding]); ...

Command line tool in Objective-C using Foundation?

Hey there, is there a simple way to create a command-line tool in Objective C? I'd rather not use XCode, because XCode has targets and executables, and just complicated stuff. I'd like to go classic way, just create a Makefile, compile something get an executable, play with it. -- If this is not possible, is there any way to run th...

Sqlite Opening Error : Unable to open database

Hi, In my app, I use a calendar control to store the information date-wise. Calendar Control's Link : http://blog.webscale.co.in/?p=244 Problem : For example, the current selected month is October 2010. Now if I switch back to April 2010 and try to comeback to Ocober 2010 & access data from calendar that I stored in the month of Oct...

how to modify title and badge icon in UITabBarController

I have the following code: tabBarViewController = [[TabBarViewController alloc] init]; mvc = [[MapViewController alloc] init]; tvc = [[TableViewController alloc] init]; tabBarViewController.viewControllers = [NSArray arrayWithObjects: tvc, mvc, nil]; However, when opening up in the simulator, I don't see any title or badge for these t...

Iphone code and android

item = [[NSMutableDictionary alloc] init]; [[self item] setObject:self.currentDay forKey:@"day"]; This is the code for iphone wat is its equivalent in java ...