iphone-sdk-3.0

MPMediaItem - NSCoding problem with MPMediaItemArtwork

僤鯓⒐⒋嵵緔 提交于 2019-11-30 21:53:57
So MPMediaItem conforms to NSCoding, but it contains a pointer to MPMediaItemArtwork, which doesn't conform to NSCoding. So if I try to archive a MPMediaItem, if that item has some artwork in it, it will not be able to unarchive. I tried to make a category of MPMediaItemArtwork and make it conform to NSCoding, but I can't seem to do that because we don't have access to the actual UIImage that it stores. Does anyone know of any other creative ways to get around this problem? I want to be able to archive an MPMediaItem, even if it means somehow stripping off the artwork object. Is there a way to

How to get the model of iPhone from code. (e.g. MC143C)

二次信任 提交于 2019-11-30 20:53:59
问题 I need to get the iPhone model number from code. I can see the model number from my iPhone which is "MC143C", but when I am retrieving this by using code it is returning "iPhone". This is the code I am using to get the model number. NSLog(@"model: %@", [[UIDevice currentDevice] model]); Can anyone please help me to have the information i want to get from my device. Thanks, !ZAQ 回答1: import https://github.com/erica/uidevice-extension 1. define modelnumber in UIDevice-IOKitExtensions.h -

How to compile pjsip for iphone 3.0

坚强是说给别人听的谎言 提交于 2019-11-30 20:46:17
问题 I have been trying to compile pjsip for iphone 3.0 but I have been unable to do so. I have tried following the guides on siphon and voiphone (open souce iphone projects that use pjsip). And apparently I am not the only one that is unable to compile pjsip for iphone 3.0 has anyone been able to do so succesfuly?. How can it be done?. Any help will be greatly apreciated. Thank you -Oscar 回答1: This page contains step-by-step instructions for compiling the latest version of pjsip for iPhone OS 3.0

One to Many relationships iPhone - NSPredicate core data query

笑着哭i 提交于 2019-11-30 20:18:47
问题 I have a have a number of calendars, which each have a number of events. I would like to find all the events for a calendar where date > x. My method signature looks like this -(NSArray*)eventsForCalender:(Calendar*)calender StartDate:(NSDate*)start endDate:(NSDate*)endDate; I added an Event to a calender like this, but I don't have a clue how to go about to construct an NSPredicate for the query. Any help appreciated -(Event*)newEventforCalender:(Calendar*)calender { Event * newEvent =

AVAssetWriterInput and readyForMoreMediaData

谁说胖子不能爱 提交于 2019-11-30 20:10:33
Is AVAssetWriterInput's readyForMoreMediaData updated in a background thread? If readyForMoreMediaData is NO, can I block in the main thread and wait until the value changes to YES? I'm using an AVAssetWriterInput by pushing data to it (i.e. without using requestMediaDataWhenReadyOnQueue) and I've set expectsMediaDataInRealTime, and 99.9% of the time I can just call appendSampleBuffer (or appendPixelBuffer) on it as fast as my app can generate frames. This works fine unless you put the device (iPhone 3GS) to sleep for 15 minutes or so in the middle of an AVAssetWriter session. After waking up

“-(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data” not called

两盒软妹~` 提交于 2019-11-30 19:58:43
问题 Have a look to this code snippet:- -(void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response { [webData setLength: 0]; } -(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data { NSLog(@"Recieving Data..."); [webData appendData:data]; } -(void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error { NSLog(@"ERROR with theConenction"); [connection release]; [webData release]; } -(void)connectionDidFinishLoading:

Can text in UILabel have a colorWithPatternImage: assigned to it?

元气小坏坏 提交于 2019-11-30 18:06:35
问题 If so, can the image be animated? Is there a good reason not to do this? Memory usage, etc? 回答1: Yes, a label can have a pattern color. alt text http://img178.imageshack.us/img178/1995/textwithpatterncolor.png // make a UIColor with an image as the pattern UIImage *tileImage = [UIImage imageNamed:@"hot_grad_64px.png"]; UIColor *patternColorTile = [UIColor colorWithPatternImage:tileImage]; // assign it to the .textColor property of a UILabel self.testLabel.textColor = patternColorTile; // the

iPhone - is it IMPOSSIBLE to grab the contents of a CALayers composition?

混江龙づ霸主 提交于 2019-11-30 16:48:02
I have a CALayer transformed in 3D on a offscreen UIView (much larger than 320x480). How do I dump what is seen on this UIView to a UIImage? NOTE: I Have edited the question to include this code... This is how I create the layer... CGRect area = CGRectMake (0,0,400,600]; vista3D = [[UIView alloc] initWithFrame:area ]; [self.view addSubview:vista3D]; [vista3D release]; transformed = [CALayer layer]; transformed.frame = area; [vista3D.layer addSublayer:transformed]; CALayer *imageLayer = [CALayer layer]; imageLayer.doubleSided = YES; imageLayer.frame = area; imageLayer.transform =

HTML String content for UILabel and TextView

馋奶兔 提交于 2019-11-30 16:11:24
问题 i got an object with contents of html markup in it, for example: string = @"<p>This is wonderful</p> <p>Also some ‘ entidies ’ <p>"; so i want first to convert this entidies in for my label text. the second step would be to convert my p tags to line breaks. the third step to convert my "img" tags to uiimageviews and some simple text formatting "b","strong" etc. have you any ideas how to solve my problem? 回答1: You should have a look at the Three20 project which includes a class

iPhone - is it IMPOSSIBLE to grab the contents of a CALayers composition?

社会主义新天地 提交于 2019-11-30 16:10:02
问题 I have a CALayer transformed in 3D on a offscreen UIView (much larger than 320x480). How do I dump what is seen on this UIView to a UIImage? NOTE: I Have edited the question to include this code... This is how I create the layer... CGRect area = CGRectMake (0,0,400,600]; vista3D = [[UIView alloc] initWithFrame:area ]; [self.view addSubview:vista3D]; [vista3D release]; transformed = [CALayer layer]; transformed.frame = area; [vista3D.layer addSublayer:transformed]; CALayer *imageLayer =