Tag: xcode

Anyone done an Objective-C Xode version of Osherove´s TDD Kata “String Calculator”?

Always trying to code better and I am interested in doing TDD for Objective-C and Xcode. Do you know any post that implement something like Roy Osherove´s “String Calculator”-Kata Update: trying to find out how to speed up TDD on iOS

Can I use a background thread to parse data?

I’m using chcsvparser to parse data from a csv file on my apps launch. It’s taking way too long to startup on main thread so I was thinking of doing this on the background thread. But I read that you can’t pass objects between the threads. The parser outputs an NSArray so is there a […]

iOS change tabbar item color is safe?

I am properly using following method to change tabbar icon color, [tabBarController.tabBar setSelectedImageTintColor:[UIColor redColor]]; but before using it I read some posts about apple’s app rejection due to this issue. I assume that if is an ios5 method must now be accepted. Is it true? Thanks.

objective c audio meter

Is it possible for xcode to have an audio level indicator? I want to do something like this: if (audioLevel = 100) { } or something similar… Any ideas?? Example code please? I’m VERY new to objective c so the more explaining the beter! 😀

PDFView setNeedsDisplay:YES doesn't work on MacOS Sierra 10.12

I have use [PDFView setNeedsDisplay:YES] to let the PDF view redraw, and it worked great on OSX 10.9-10.11. However it doesn’t work unless I zoom in or zoom out the PDF page… Is there any other way to redraw immediately? Code below: NSRect newBounds; NSRect currentBounds; NSRect dirtyRect; NSPoint mouseLoc; NSPoint endPt; // Where is […]

Obj-C, Instance variable used while 'self' is not set to the result of ''

I know I asked a similar question to this not long ago, but I’m still a little unsure about it. The same sort of thing happens in several places. Instance variable used while ‘self’ is not set to the result of ‘[(super or self) init…]’ A – (id)initWithCoder:(NSCoder *)decoder { if (![super init]) return nil; […]

Xcode: How do I change UIPageControl value with swipe gesture?

I have a quick question I was hoping you guys could help me answer. Right now I have a UIPageControl in a storyboard which changes an image depending on what dot you are on, however, as of now you have to press on the dot to change through the dots/images, how can I change through […]

How do I set these break points in ~/.gdbinit?

Here is a list of break points to put in ~/.gdbinit that are really helpful in debugging memory problems: fb -[NSException raise] fb -[NSAssertionHandler handleFailureInFunction:file:lineNumber:description:] fb -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] #define NSZombies # this will give you help messages. Set to NO to turn them off. set env MallocHelp=YES # might also be set in launch arguments. […]

create a UIWebView and load a website programmically

The following is my code. I simply want to load a website page and put a back button on screen. Don’t know why nothing shows on the screen. in .h #import <UIKit/UIKit.h> @interface ThirdViewController : UIViewController { UIWebView *myWebView; } @property (nonatomic, retain) UIWebView *myWebView; -(IBAction)goBack:(id)sender; @end in .m #import “ThirdViewController.h” @implementation ThirdViewController @synthesize myWebView; […]

Cocoa – NSFileManager removeItemAtPath Not Working

I am trying to delete a file, but somehow nsfilemanager will not allow me to do so. I do use the file in one line of code, but once that action has been ran, I want the file deleted. I have logged the error code and message and I get error code: 4 and the […]