iOS Development is easy with XCode, Swift3, UITableView, cocatouch, let's build iPhone, iPad and Macbook Applications.

Calling C function in Objective-C Awake from Nib

I had to implement a C function in an Objective-C class that normally would get called with int main (in it’s own file). Since I’m unfamiliar with splicing code I need to know how to have it called upon in either the awakefromnib or applicationDidFinishLaunching from within the Cocoa section. Or if there’s a much […]

CodeSign Error after changing Product Name

I recently come across a hectic problem when App Store rejected my application saying that the App Name and the Product Name are not same. I followed the steps told by them to change the product name. But when I rebuilt the app, it gives me a codesigning error: Error : codesign failed with exit […]

How to pass pointer to a reference as an argument to a function-Objective C

In C++ we will pass the pointer to a function as bool getData(REMOTE_ID msId,RsEvent*& pEvent); How to declare this in Objective C? // ? -(BOOL)getData:(REMOTE_ID)msId withEvent:(RsEvent*)pEvent; But i need to use the pointer to reference (RsEvent*&). I have used only pointer (RsEvent*) as a datatype here.

Objective-C Memory Question

Is it a leak if I have a view controller and allocate the view like this: self.view = [[UIView alloc] initWithFrame:frame]; Do I need to do something like this: UIView *v = [[UIView alloc] initWithFrame:frame]; self.view = v; [v release];

UIView in cell — Can't round right-hand corners

I have a rectangular UIView object in a static table view cell. I have an outlet to the object and I’m trying to selectively round corners but it will not round corners on the right. Here’s what it looks like in the storyboard: The view I want to configure is the pale yellow one. The […]

Objective-C, sorting muti-dimensional arrays

I’ve been having some trouble with sorting multi-dimensional arrays in Objective-C. I basically have an array of which every element is an array of the form: (NSString, NSDate, NSString, NSString) such that my top level array has the form: ( (NSString, NSDate, NSString, NSString), (NSString, NSDate, NSString, NSString), (NSString, NSDate, NSString, NSString), (NSString, NSDate, NSString, […]

objective-c autorelease

Im new to obj-c and have trouble understanding the function autorelease. could someone explain to me when i should use it? and how is it different than release. also do I need to reset the autorelease pool? how? and when?

retainCount in blocks show extrange behavior

I got the this code in a class: – (void)cancel { if (_cancelBlock) _cancelBlock(); } – (void)overrideCancelWithBlock:(void(^)(void))cancelBlock { [_cancelBlock release]; NSLog(@”AsyncOperation-overrideCancelWithBlock-[cancelBlock retainCount]=%lu (before)”, [cancelBlock retainCount]); _cancelBlock = [[cancelBlock copy] retain]; NSLog(@”AsyncOperation-overrideCancelWithBlock-[_cancelBlock retainCount]=%lu (after)”, [_cancelBlock retainCount]); } – (void)dealloc { NSLog(@”AsyncOperation-dealloc-[_cancelBlock retainCount]=%lu (before)”, [_cancelBlock retainCount]); [_cancelBlock release]; NSLog(@”AsyncOperation-dealloc-[_cancelBlock retainCount]=%lu (after)”, [_cancelBlock retainCount]); [super dealloc]; } The […]

How to save the audio with changed pitch and speed iOS?

I’m able to change the pitch and speed of my audio but I’m getting problem in saving the audio with changed pitch and speed //this is method which set the pitch [self.audioEngine connect:audioPlayerNode to:timePitchEffect format:nil]; [self.audioEngine connect:timePitchEffect to:self.audioEngine.outputNode format:nil]; [audioPlayerNode scheduleFile:self.audioFile atTime:nil completionHandler:nil]; [self.audioEngine startAndReturnError:&audioEngineError]; NSLog(@”%@”,self.audioFile.url); if (audioEngineError) { NSLog(@”%@”,@”whats this!!!”); } // call the […]

Async execution of shell command not working properly

So, this is my code : – (void)runCmd:(NSString *)cmd withArgs:(NSArray *)args { NSLog(@”\nRunning ::\n\tCmd : %@\n\tArgs : %@”,cmd, args); [theSpinner start]; if (task) { [task interrupt]; } else { task = [[NSTask alloc] init]; [task setLaunchPath:cmd]; [task setArguments:args]; [pipe release]; pipe = [[NSPipe alloc] init]; [task setStandardOutput:pipe]; NSFileHandle* fh = [pipe fileHandleForReading]; NSNotificationCenter* nc; nc […]