objective-c

Getting raw display data from NSView

hi-- my goal is to send an NSView over the wire. i was wondering whether there was a way to get the raw display data contained in an NSView so that I can send this data over the wire and re-display this at the destination. thanks. ...

iphone sdk hide uitextview on uibutton click

im new to iphone sdk programming, and have been stuck on this problem for days. i want a button that toggles a uitextview. first click shows the textbox, second click hides it and so on. it sounds very simple ...

Quartz 2D's drawing text and NSTimer in custom method

i want to show text using quartz 2d. Text will be drawing randomly on different position after each 1 seconds. I am not sure how i can use NSTimer with quartz 2D text. I can draw text in drawRect method where graphics context is already available. How i will draw text using my custom method myDraw which will be called after 1 second usin...

Problem while fetching xml through some rss feed

I was fetching xml through some rss feed. I am unable to sort items in depth like i have sorted easily "channel -> description" as NSString *resultValue=[[responseDictionary valueForKeyPath:@"rss.channel.description"] textContent]; Above Result: YouTube RSS Feed My question is how i can parse .... item -> description... i.e (Music vi...

Convert NSString to string

NSDate *now = [NSDate date]; NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; [formatter setDateFormat:@"yyyy"]; NSString *stringFromDate = [formatter stringFromDate:now]; CGContextShowTextAtPoint(context, 50, 50, stringFromDate, 5); I...

how to create button in cocos2d?

Hi all, I am new to cocos2d, In that I want to create a button, by touching the same some events should be generated. But I don't know how to make a button in the same. As well as want to save username also. But I am not able to create a text box even. If any one know, kindly help to create both of the things. Thank you in advance. ...

how to get hour minute from NSDate

Hi in my application i need to get the hour and minute seperately, NSString *currentHour=[string1 substringWithRange: NSMakeRange(0,2)]; int currentHourInNumber=[currentHour intValue]; consider string1 contains "11:59:13 AM" which is coming from datepicker. here if i use above code, its okay to get hour if its greaterthan 9. e...

why retain of delegate is wrong what are all alternatives...?

Hi, I have one problem let assume A and B are 2 view controller from A user push to B view controller,In B user starts some download by creating object C(which is NSObject class) and sets B as delegate to C(assign),now user want go back to A then dealloc of B calls object releases, C delegate fails to give call back(crashes).I want to ...

Get info for remote audio files

to get metadata for audio file i can use: NSDictionary *aMetadata = [aPath MDIAttributes:[aPath allMDIAttributesNames]]; but it doesn't work with remote files, in case of images i solved this problem with CGImageSourceRef and so on functions. Does anybody know something like this for audio files? ...

UIButtonTypeRoundedRect as an accessoryView

Hello, I have a table view and I want to put a label on the right of each cell, so in - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath I'm having some code like this UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect]; button.titleLabel.text = @"title"; cell.accesso...

a Problem to pass a string between 2 view controller (iPhone)

my problem is quite simple, but as a beginner, I'm lost :D I have to view controller : view one call view 2 like this : self.FacebookTypeRequest =@"favoris"; FaceBookViewController *viewcontrol = [[FaceBookViewController alloc]initWithNibName:@"FaceBookViewController" bundle:[NSBundle mainBundle]]; viewcontrol.title = @"FaceBook"; ...

constructor in objective c

HI, I have create my iPhone apps but i have a problem. I have a classViewController where i have implemented my program. I must alloc 3 NSMutableArray but i don't want do it in a grapich methods. There isn't a constructor like java for my class? Thanks so much and sorry for my english XP // I want put it in a method like constructor jav...

Interface Builder warnings

Hi all, I am getting an warning while building my source code as follows: /* com.apple.ibtool.document.warnings */ /Users/biranchi/Desktop/Hotlist v2.0/Classes/HLCheckinViewController.xib:6: warning: The separator style "Single Line Etched" is not supported on iPhone OS versions prior to 3.2. What is this error due to ? Thanks ...

standard encryption decryption across different platforms

hey guys i need to implement a standard encryption decryption logic across an entire project platform which has different clients implemented using different platforms as follows: iphone app (objectiv c) website (classic asp) webservice (asp.net) samsung bada app (c++) the iphone app as well as the website need to send info to webser...

iPhone - dequeueReusableCellWithIdentifier usage

Hi, I'm working on a iPhone app which has a pretty large UITableView with data taken from the web, so I'm trying to optimize its creation and usage. I found out that dequeueReusableCellWithIdentifier is pretty useful, but after seeing many source codes using this, I'm wondering if the usage I make of this function is the good one. Her...

Objective C BitConverter Equivalent

Hi there, I'm wondering if there is an Objective C equivalent to .Net's BitConverter.GetBytes() method. For example, in C#, I can write something like this: byte[] lengthPrefix = BitConverter.GetBytes(message.length); What would the equivalent be in Objective C? Some example code would be greatly appreciated. Thanks in advance. ...

Initialization problem

I have a problem. This is my code. When i try to use the IBAction SavePosition the "arrayPosition" isn't update. Else if i initialize the "arrayPosition" in "SavePosition" the value is stored in the array. Why this anomaly? #import <UIKit/UIKit.h> @interface AccelerometroViewController : UIViewController <UIAccelerometerDelegate, UITex...

Will iPhone OS4 make your life easier or harder as a lone app developer?

I am interested to hear what people feel about the new iPhone OS4 release. It is obviously very exciting having access to all the new features, apparently (from apple.com) it has over 1500 new APIs. My original thoughts were "Wow, this is awesome", and I suppose it is. I was just getting comfortable with OS 3.2 development though, and n...

Objective-C++ pre-compiled headers

I'm using a C++ library (it happens to be in an iPad application, but I'm not sure that should make any difference) and would really like to have the headers pre-compiled to speed up the builds, but xCode seems to run the pre-compiled header file through the C compiler rather than the C++ one. Is there a way to get it to use the right c...

Equivalent Carbon 32-bit call for using in 64-bit application - GetApplicationEventTarget().

Hi All, I'm writing a 64-bit Cocoa application. I need to register for global key events. So I wrote this piece of code : - (void)awakeFromNib { EventHotKeyRef gMyHotKeyRef; EventHotKeyID gMyHotKeyID; EventTypeSpec eventType; eventType.eventClass=kEventClassKeyboard; eventType.eventKind=kEventHotKeyPressed; eve...