cocoa

How to disable any grouping in NSNumberFormatter?

NSNumberFormatter has a method - (void)setGroupingSize:(NSUInteger)numDigits when I would provide a 0 here, is that disabling any grouping for sure? I really don't want any grouping to happen, no matter if the user has a locale of Takawaka or US. I need a safe way to get rid of any grouping here. Anyone? ...

How to force NSLocalizedString to use a specific language

on iPhone NSLocalizedString returns the string in the language of the iPhone. Is it possible to force NSLocalizedString to use a specific language to have the app in a different language than the device ? ...

Trouble creating an iTunes style source list in Cocoa

I'm working on a piece of software that would work well with an iTunes style source list. I have been looking around the net for how to implement it but all the examples seem a bit sketchy. I found Mark Alldritt's implementation and tried to use it in my project but it is rendering incorrectly. The cells seem to be rendering half outsi...

algorithm to add randomly-generated NSStrings to NSMutableArray

The goal is to generate an NSString chars in length and assign each string to an array. I'm getting stuck on what I need to do with my algorithm to get the correct result. Here's the sample. The result I get is the same randomly generated string added to my array 26 times instead of 26 DIFFERENT strings added. I've thought about de...

How do I model a selected entity instance from a set of possible instances in Core Data?

I have two Core Data entities, say Account and House. Each account can have a list of houses and a house can only be in one account, so that's a regular one-to-many relationship with an inverse. An account also has a "primary" property that indicates which of the many possible houses is primary or is nil if there are none. The identity ...

Updating Value in Core Data

Hi all, I'm trying to write a simple stock check program, and I have a Table View binded to Core Data. The table has 3 columns: Model, Price and Quantity In Stock. I have a NSTextField and a NSButton underneath this, so that the user can enter the quantity they wish to buy, and when they click "add to cart", the program should fetch the...

Get union of the frames of several transformed UIImageViews?

I've got a collection of roughly 10 overlapping UIImageViews. Each one is rectangular but each is rotated and scaled separately. Are there any Core Graphics tricks for drawing a path around the perimeter of ALL the images? CGRectUnion may give me a rectangle encompassing all the views (though I vaguely remember the frame is undefined o...

Application hanging in __semwait_signal ()

I have a user of my application that sometimes when they run the application it gets stuck at the following point ... 0x92542782 in __semwait_signal () (gdb) where #0 0x92542782 in __semwait_signal () #1 0x9254243e in _pthread_cond_wait () #2 0x925440d8 in pthread_cond_wait$UNIX2003 () #3 0x95232670 in fe_fragment_render_quad () #4 ...

Sending variables to php from Cocoa Touch on iPhone sdk

Hi am trying to pass variables to php from inside an app. <?php // get email address $email = $_GET['email']; // get character name $character = $_GET['character']; // get password $charname = $_GET['charname']; // set up variables $id = 0; $idtest="no"; // set up database connection $link = mysql_connect("localhost", "xxx username xx",...

Is it valid to ask an NSNumber for an NSDecimal value whe the NSNumber was initialized with an Integer?

Example: I have an NSInteger and I wrap that into an NSNumber object. Now I want to have an NSDecimal with the value of that NSInteger. So could I ask: NSDecimal myDecimalFromMyInteger = [myNSNumberObject decimalValue]; Or is this problematic on some way? Or must I always ask for the exact same value as I used to create the NSNumber ...

Best idea for importing text to each NavigationController View

Hi everyone i want build a poem application so i want use to NavigationControlle for show each poem ! i mean i have a TableView and on there + 50 poems ! each cell have different poem ! so what can i do to import each text or HTML Files(My Pomes) to special view , that work with navigation controller ? is it good idea to use NSArray to ...

Best way to install a custom cocoa framework

I have a custom framework that, following the advice in Apple's Framework Programming Guide >> Installing your framework I install in /Library/Frameworks. I do this by adding a Run Script build phase with the following script: cp -R build/Debug/MyFramework.framework /Library/Frameworks In my projects I then link against /Library/Fram...

What's the cleanest way to bind enumerated properties?

I have a menu which has an item for each value in an enum. The menu: [ ] Sort by Due Date [ ] Sort by Priority [√] Sort by Title The enum: typedef enum CW_TASK_SORT_METHOD { CWTaskSortMethodDueDate, CWTaskSortMethodPriority, CWTaskSortMethodTitle } CWTaskSortMethod; The property: @property(readwrite, assign) CWTaskSo...

How would an iTunes-style Source-List be implemented with Bindings+CoreData in Cocoa?

Let's say, for illustration, I was writing an iTunes clone app in Cocoa, that was backed by CoreData. For simplification's sake, let's say there are two "sections", "Library" with things like Music, Movies, Radio, etc. And a second section called "Playlists" which holds user-generated playlists (just dumb lists, not smart playlists). So...

How to display time in seconds in Cocoa efficiently?

I want to display the time (including seconds) in an application in a text field, pretty simple. What I currently do is create a NSTimer that runs every 0.1 seconds that gets the system time and updates the text field. This seems like a terribly inefficient way to accomplish this. Is there a better way? ...

Set contents of webview to html string (cocoa)

Hi, Is there any easy way to set the contents of a webview to an html string (without having to load a file)? Thanks ...

How do I use NSTreeController, NSOutlineView and Core Data with an "invisible" root item?

I have a Core Data model which consists of a simple tree of a particular entity, which has two relationships, parent and children. I have an NSTreeController managing the model, with an NSOutlineView bound to the NSTreeController. My problem is that I need a single root object, but this should not display in the outline view, only its c...

Which methods and class will be invoke when reload a webpage or open a new webpage in safari

As we know , When we load frame from webpage of safari, we will invoke the delegate methods of webkit informal protocol(WebFrameLoadDelegate): webView:didStartProvisionalLoadForFrame: webView:didChangeLocationWithinPageForFrame: But I want to know whick class and methods will be invoked when reload a webpage or open a new webpage ...

CFReadStreamRef and size of bytes available

hai all, I'm trying to implement a Streaming music Player using iphone sdk, based on the sample code by Matt Gallagher ( http://cocoawithlove.com/2008/09/streaming-and-playing-live-mp3-stream.html) now i would like to know how can i get the number of bytes available in the CFReadStreamRef . After a long search i got the code to find t...

How to get a flash url in a webpage using a webframe?

As we know , When we load frame from webpage of safari, we will invoke the delegate methods of webkit informal protocol(WebFrameLoadDelegate): webView:didStartProvisionalLoadForFrame: webView:didChangeLocationWithinPageForFrame: and I know when reload the page I can do this: - (void)webView:(WebView *)senderdidStartProvisionalLoadFor...