objective-c

color of hyperlink in iphone

Hi everyone, is there a way to change hyperlink color in situations when UITextView and, for example, .dataDetectorTypes = UIDataDetectorTypePhoneNumber; are used? Thanks in advance! ...

obj-c duplicate symbol for header variable

It was my impression that using #import would only import a file once per build, yet after trying to define a variable in a header, and then importing that header in two different source files, I get a duplicate symbol linker error for the variable. How is this possible? ...

NSXMLParserErrorDomain in Objective C ?

Hi all, I have set up a local server using XAMPP. I am making a request to the PHP pages , but i am getting an error as below: "Parser Error : Error Domain=NSXMLParserErrorDomain Code=5 "Operation could not be completed. (NSXMLParserErrorDomain error 5.)" What is this error due to ? Thanks ...

Chaining Core Animation animations

Which is the most elegant and modular way to chain animation in a Core Animation context? I mean to do animations that starts just when other finished (for example, changing position and then opacity).. normal approach is to directly change properties: layer.position = new_point; layer.opacity = 0.0f; but this will do them at the sa...

What's the fastest way to determine the time of day of an NSDate or timestamp?

I need to display a date and, if it's not representing midnight, the time of that date using an NSDateFormatter. This is how I'm currently checking to see if it's midnight: int minute = [[CalendarUtil cal]ordinalityOfUnit:NSMinuteCalendarUnit inUnit:NSDayCalendarUnit forDate:date]; if (minute =...

How to Convert NSInteger or NSString to a binary (string) value

Anybody has some code in objective-c to convert a NSInteger or NSString to binary string? example: 56 -> 111000 There are some code in stackoverflow that try do this, but it doesn´t work. Thanks ...

Is there a native YAML library for iPhone?

I'm considering using YAML as part of my next iPhone application, but I haven't been able to find an Objective-C library to use. The Wikipedia page for YAML mentions one, but the link is dead. Is there an Objective-C library that can parse YAML into native collection objects (NSArray, NSDictionary, etc...)? ...

Inconsitant results with Pinches in a UITextView

I'm trying to figure out the best way to handle pinch gestures in a UITextView. Currently I've been trying to handle it all in the UITextView, but I'm getting inconsistant results. It seems that it can catch my touches in the touches began method, but it doesn't always get caught in the touches moved method. Would it be better to hand...

iPhone ViewController Affecting IBOutlet of Another ViewController

I have two View Controllers: TableViewController (which is used as a modal view controller) and ToolbarController. In Interface Builder I have ToolbarView, which is controlled by the ToolbarController. ToolbarView has an IBOutlet UIWebView that ToolbarController controls (uses buttons on a tool bar to switch pages in a webview). What I...

Decomposing an iPhone user interface -- multiple views in one xib?

I have one main view with an associated controller. I have some rather complicated toolbars that I need to switch in and out depending on user interaction. To keep things simple I manage the toolbars with my main view controller, rather than having all sorts of intertwined dependencies or really deep delegate chains. Anyway, how can I ...

Hightlight color for NSDatepickerCell

I am trying to do a little timer app in Objective-C/Cocoa. I am using the NSDatePicker to be able to set the start value. I managed to change the text color to green, because the whole app will be in green on a HUD panel: But there is a problem. Whenever I am using the picker to change the value, it highlights it wit a gray color and ...

How to save aUIImage using NSUserDefaults

How do I save an Image to User Defaults ...

Any idea why glVertexPointer() wouldn't draw anything when using GL_FLOAT?

Using GLfixed as my vertex number type the following code draws textures as expected: GLfixed vertices[] = { (int)point.x, (int)point.y + size.height, (int)point.x + size.width, (int)point.y + size.height, (int)point.x, (int)point.y, (int)point.x + size.width, (int)point.y }; glVertexPointer(2, GL_FIXED, 0, vertices); I read...

Observing a Change to ANY Class Property in Objective-C

Put simply, is there a way to receive a general notification when any property in an Objective-C class is changed? I know I can use KVO to monitor particular property changes, but I have the need to call a particular method whenever any setProperty: message is sent to my class. I want to be able to receive a generic notification without ...

Getting started with cocoa drawing

I want to do some custom drawing in a NSView subclass where should I get started? ...

Objective-C - where to put the NSNotificationCenter ?

Hi, i have an NSNotificationCenter selector, where to put it ? in the delegate (if yes then where?) in the controller? where to put the method as well. do i need to dealloc the NSNotificationCenter ? [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(deviceNotificationReceived:) name:UIApplicationDidBecomeActiv...

Documentation Framework like JavaDoc for Objective C

Does Objective C have a documentation framework similar to JavaDoc where documentation can be generated from the source code? ...

What is the best scripting language to embed in Mac OS X 10.6 applications?

Is there any other scripting language that can be used to embed scripts inside applications, which can access Mac OS X, or application classes with the same features, or most of the features seen in F-script? ...

making a text field required in objective-c

I'm currently in the process of developing an app for the iPhone. There is a screen which requires users to enter their data in text format but it can easily be skipped by simply clicking the 'submit' button. Is there a way I can make these text fields required? ...

iPhone app with audio files is just too big. How do I reduce the size?

I have a BlackBerry app that I am about to port to the iPhone. The app contains mp3 files which causes the BlackBerry version to be about 10MB in size (even after I reduced the quality of the files to 92kbps). 10MB won't do for the iPhone. Does anyone know of any best practices when it comes to including audio files in your iPhone app? I...