objective-c

Inserting image into NSTableView using bindings

I've an NSTableView bound to an NSArrayController with two columns. One column is bound to the arranged objects of the array controller and displays a string. I'd like to display an image in the other column, but I just can't make it work. I've dragged an NSImageCell to the column and set the image by hand but it won't show up at runti...

Cocoa: Build Warning that s Forward Declared Class's and @interface May not Exist

I am trying to build the Clustering Plug in my project under Leopard. I have following two questions. In the project an interface class is defined as @interface ClusteringController : NSWindowController { ....... ..... .... } @end. And this class is used in implementation class using forward declaration: @class ClusteringController...

how to convert NSarray into NSString

how to convert NSarray into NSString in objective-c. ...

i want to send the data taken from the database into mailcomposer ?

i am sending the data taken from the database into the mail composer. i have taken the data into a array from database and i have converted it into string but when i am adding the data in to mail composer it is coming in random number . here is the code that am using to add the array taken from data base into string and then adding to...

How to cancel my own test in-app-purchase transaction? (so I can test again)

I'm implementing an in app purchase for an iPhone app. All is good - store kit is very easy to use and everything is working after few hours of programming. Problem is : my product is non consumable, thus once I bought it, the app store always says that I already have it and does not let me test the payment again, it just calls transact...

[iPhone] Howto switch between UIViewControllers without using a tab bar?

Hi all, I have a UINavigationController. In the 2nd level of my hierarchy, I want to show a view controller with a toolbar in which I inserted a segmented control. Through it the user can select between two "views" of the same page that we can call A and B (like in the Calendar application). When the user press the A segment, the A vie...

Localized price from App Store

I'm putting links to other apps by the same company into an iPhone app, and we want to display the price of those apps. Is it possible to somehow get the localized price string (amount and currency) that's appropriate for the user? I imagine I'd have to resort to something like screen scraping, but I've seen that people can get quite a l...

CS193P - Assignment 3 - drawRect get called only on the first setNeedsDisplay.

Hi! I'm taking CS193P iPhone Development courses, and even if.. I know that I'm pretty late comparing to Stanford's students, I'm doing Assignment 3. My current problem is: My drawRect method does not get called on every setNeedsDisplay... but only on the first. Also, what I noted is that my polygon object is NULL (from PolygonV...

How to add a badge to the system generated "More" UITabBarItem

My app has 6 menu items, so the OS shows the first 4, then shows a "More" item that links to a screen where the user can select the other two. My problem is that I want to show a badge on the More item so that the user knows that one of the menu items that is hidden needs their attention. (It's clear to our users which hidden item the b...

OBjective-C : Use NSTimer while the app is close

hi , it is possible to use a timer that is working when the application is closed? and when the timer is finish it send a push notification ?? thx ...

Compiler fails to catch variable redefinition in conditional block

int bar = 2; if (bar) { int bar; } Neither gcc or Clang manages to issue a warning (or error) for this, and the program crashes immediately on launch. Is there a good reason for this? It doesn't seem like it would be something hard to catch. It's the basics of block scoping: the nested scope inherits the names of the enclosing block...

What is a document in this context?

I'm a bit confused regarding the document architecture. Lets look at MSN for Mac - what would the document be in that application? The contact list? The text we insert to talk to other people? When the need comes to save or read data into the application, what type of data should it read? Contact lists or chat logs? Update: Pushing thi...

Custom NSView Fill Paints Over Bottom Bar

I have a window which has a custom NSView and has a bottom bar with controls on it, one of which is an NSColorWheel. For simplicity sake the Window is 332px high, with the custom NSView being 300px high and the bottom bar being 32px high. The bottom bar is created as part of my awakeFromNib when the app loads the window using the follo...

Calling a function from a different view controller for iphone

Hi All, I have a problem where I want to call a function defined in one view controller from another controller. I'v try what seems llke a hundred different setups and nothing seems to work. I've posted the basic code and was hoping someone could tell me how they would do it. Basically all I want to do is call the MYBPress function defi...

Objective C Convert int to NSString (iPhone)

I have the following code that is meant to convert milliseconds into hours, mins and seconds: int hours = floor(rawtime / 3600000); int mins = floor((rawtime % 3600000) / (1000 * 60)); int secs = floor(((rawtime % 3600000) % (1000 * 60)) / 1000); NSLog(@"%d:%d:%d", hours, mins, secs); NSString *hoursStr = [NSString stringWithFor...

how to find what hook/method is being called in a framework

hi all, I was wondering how should I proceed to debug while working with frameworks. Like specifically how can i tell which method is being called when a particular event happens. thanks raja ...

Changing color of section header in UITableview

Hello, i have pretty simple simple question (i hope so). How do i change the section header color in a UITableview from default blue to black transparent? Thanks in advance. ...

iPhone: How to fix a legacy iPhone app which has really bad memory management? unittesting?

Hi, I recently inherited an iPhone app. The original developer did not understand memory management and well the app works in simlulator but not in on old iPhone (lots of crashses). Do you have any thoughts on the process by which I can save the app? Can I utilize or create any unittest to find memory leaks and make the process 'scien...

read from NSMutableDictionary without leaks ;)

Hello everyone. I've searched for some time already so I ask my question. I want to display data in a UITableView. each content of each cell of this tableview is set in an object specially created for this purpose (cellPlainObject). a cellPlainObject contains many strings, images and so on ... theses cellPlainObject are storred in a N...

release and retain

Let's say I do the following (foo starts out as some object): [foo release]; // STUFF with foo [foo retain]; As long as I'm not re-assigning foo, at the end of this I'll still have the same foo, right? I'm not risking losing foo during the //STUFF am I? I guess I'm making sure that my understanding of release is correct. If I rel...