Search Results

Search found 15682 results on 628 pages for 'iphone'.

Page 141/628 | < Previous Page | 137 138 139 140 141 142 143 144 145 146 147 148  | Next Page >

  • How to save video from a url to disk, also how to begin playback after some buffering?

    - by Shizam
    First question is, given a url to an mp4 video, how can I save that file to disk? The followup to that is while its saving, can I begin playback after its buffered some of the video to disk or do I have to wait for the entire file to be written and then: MPMoviePlayerController* theMovie=[[MPMoviePlayerController alloc] initWithContentURL:theURL]; using the path to the local file. Thanks, Sam

    Read the article

  • Core Data ANY BETWEEN predicate

    - by Mike Weller
    I'm trying to create an NSPredicate to find 'projects' that contain 'sessions' within a certain date range. I tried this at first: [NSPredicate predicateWithFormat:@"ANY sessions.date BETWEEN {$STARTDATE, $ENDDATE}"]; But I get an exception: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'to-many key not allowed here' It seems BETWEEN does not work with ANY in this way. I'm also limited in use of () and AND clauses meaning I can't use something like: [NSPredicate predicateWithFormat:@"ANY (sessions.date > $STARTDATE && sessions.date < $ENDDATE)"]; If I try that I get a parse error. How can I do this? Thanks UPDATE: Note that this: [NSPredicate predicateWithFormat:@"ANY sessions.date > $STARTDATE && ANY sessions.date < $ENDDATE"]; Is incorrect because it returns a project where there is a session greater than the start date and another session less than the end date but no session in between.

    Read the article

  • Ad Hoc Distribution - Does it update an existing previous installed version of an app?

    - by Kriem
    What happens when a user installs an ad hoc distribution of an existing app? And what happens if this app (or a newer one) hits the App Store officially? To sum it up: A user already has a v1.0 and receives a v2.0 ad hoc A user has the ad hoc v2.0 and the official public release of v2.0 hits the store A user has the ad hoc v2.0 and an official public release of v3.0 hits the store In other words, is the ad hoc version a stand-alone build or does it in fact update a previous version as expected from an update? And will it be updated as soon as a newer version hits the store?

    Read the article

  • XCode can't find base SDK

    - by Moshe
    XCode 3.2.3 Beta does not allow building for below 3.2. I opened a project that was made in an earlier XCode. For some reason, the base SDK is reported as missing even after changing it to 4.0. Other projects from earlier XCode do not have this issue. What can I do?

    Read the article

  • Why I can't update my UIImageView?

    - by Tattat
    I make my own UIImageView, like this: @interface MyImageView : UIImageView{ } And I have the initWithFrame like this: - (void)initWithFrame{ UIImage *img = [UIImage imageWithContentsOfFile: [[NSBundle mainBundle] pathForResource:@"myImage" ofType:@"png"]]; CGRect cropRect = CGRectMake(175, 0, 175, 175); CGImageRef imageRef = CGImageCreateWithImageInRect([img CGImage], cropRect); self = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 175, 175)]; self.image = [UIImage imageWithCGImage:imageRef]; [self addSubview:imageView]; CGImageRelease(imageRef); } I want to change the image when the user touchesBegin, so I have something like this: - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { UIImage *img = [UIImage imageWithContentsOfFile: [[NSBundle mainBundle] pathForResource:@"myImage2" ofType:@"png"]]; CGRect cropRect = CGRectMake(0, 0, 175, 175); CGImageRef imageRef = CGImageCreateWithImageInRect([img CGImage], cropRect); self = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 175, 175)]; [self setImage:[UIImage imageWithCGImage:imageRef]]; CGImageRelease(imageRef); } I find that I can't change the image. So, I add a line [self addSubview:imageView]; in the touchesBegan method, that's work. But I have no idea on why I can't change the image from the touchesBegan, thz.

    Read the article

  • AudioQueueOfflineRender returning empty data

    - by hyn
    I'm having problems using AudioQueueOfflineRender to decode AAC data. When I examine the buffer after the call, it is always filled with empty data. I made sure the input buffer is valid and packet descriptions are provided. I searched and found that a few others have had the same problem: http://lists.apple.com/archives/Coreaudio-api/2008/Jul/msg00119.html Also, the inTimestamp argument doesn't make sense to me. Why should the renderer care where in the audio the beginning of the buffer corresponds to? The function throws an error if I pass in NULL, so I pass in the timestamp anyway.

    Read the article

  • Easiest way to support multiple orientations? How do I load a custom NIB when the application is in

    - by Peter Hajas
    Hi there, I have an application in which I would like to support multiple orientations. I have two .xib files that I want to use, myViewController.xib and myViewControllerLandscape.xib. myViewController.xib exists in project/Resources and myViewControllerLandscape.xib exists in the root project directory. What I want to do is use a separate NIB (myViewControllerLandscape.xib) for my rotations. I try detecting rotation in viewDidLoad like this: if((self.interfaceOrientation == UIInterfaceOrientationLandscapeLeft) || (self.interfaceOrientation == UIInterfaceOrientationLandscapeRight)) { NSLog(@"Landscape detected!"); [self initWithNibName:@"myViewControllerLandscape" bundle:nil]; } But I can see in gdb that this isn't executed when the app is started with the device in landscape. The NSLog message doesn't fire. Why is this? What have I done wrong? Also, if I explicitly put the initWithNibName function call in the viewDidLoad method, that nib is not loaded, and it continues with the myViewController.xib file. What's wrong with my call? Should I specify a bundle? Thanks!

    Read the article

  • Touch event in CPLayerHostingView?

    - by senthilmuthu
    Hi, i am using Core-plot . but when i declare the normal UIView as CPLayerHostingView,how can i handle drawRect of that view , i cant give another custom UIview name and write code in drawRect of that view?please any help to handle drawRect of CPLayerHostingView?

    Read the article

  • decompressing .gZ file from Document directory?

    - by senthilmuthu
    hi, i am having .gZ (zip file) in document directory.i want unZip it.but i am using libz.dylib framework .will it decompress and save all data to that file path?how can i get that extracted data?any has experienced in doing this?any help?when i use the method,but when i put break point, it returns data error(used in NSLog)--Z_DATA_ERROR-- - (id)initWithGzippedData: (NSData *)gzippedData; { [gzippedData retain]; if ([gzippedData length] == 0) return nil; unsigned full_length = [gzippedData length]; unsigned half_length = [gzippedData length] / 2; NSMutableData *decompressed = [[NSMutableData alloc] initWithLength:(full_length + half_length)]; BOOL done = NO; int status; z_stream strm; strm.next_in = (Bytef *)[gzippedData bytes]; strm.avail_in = [gzippedData length]; strm.total_out = 0; strm.zalloc = Z_NULL; strm.zfree = Z_NULL; if (inflateInit2(&strm, (15+32)) != Z_OK) { [gzippedData release]; [decompressed release]; return nil; } while (!done) { // Make sure we have enough room and reset the lengths. if (strm.total_out >= [decompressed length]) [decompressed increaseLengthBy: half_length]; strm.next_out = [decompressed mutableBytes] + strm.total_out; strm.avail_out = [decompressed length] - strm.total_out; // Inflate another chunk. status = inflate (&strm, Z_SYNC_FLUSH); if(status == Z_DATA_ERROR) { NSLog(@"data error"); } if (status == Z_STREAM_END) done = YES; else if (status != Z_OK) break; } if (inflateEnd (&strm) != Z_OK) { [decompressed release]; return nil; } // Set real length. [decompressed setLength: strm.total_out]; id newObject = [self initWithBytes:[decompressed bytes] length:[decompressed length]]; [decompressed release]; [gzippedData release]; return newObject; }

    Read the article

  • NSPredicate acting strange in NSFetchedResultsController

    - by Scott Langendyk
    I feel as if this should be very simple, but it's behaving strangely. I have 3 entities, with a relationship as such Entity A <-- Entity B <<-- Entity C I have an NSFetchedResults controller and I'm trying to filter the results of Entity A using the following predicate. [NSPredicate predicateWithFormat:@"NONE entityB.entityC == %@", self.entityC]; When I try and run the app, the output shows no results. I can alter the predicate slightly to: [NSPredicate predicateWithFormat:@"ANY entityB.entityC == %@", self.entityC]; And it shows me only the results that I want it to filter out. Why is this happening?

    Read the article

  • UITableViewCell indentation not in edit mode.

    - by Eric P.
    When you enter editing mode on a grouped-style UITableView, the cells indent to show the editing control (if you aren't sure what I mean, see this picture (editing mode) http://i.imgur.com/GJXvL.png and this (non-editing mode) http://i.imgur.com/ahKYS.png). I am trying to manually indent a cell when the tableView is not in editing mode. I tried the indentationLevel property, but that just moves the text further to the right inside the cell and doesn't actually change the cell. Any ideas?

    Read the article

  • cannot dismiss the email composer view in iphone?

    - by Warrior
    I am new to iphone development.I have created a tabbar based application . In the first i want the email composer to be displayed. I am able to display it but the cancel and send button are not working,I don't know where do i go wrong .Please help me out. Here is my code. - (void)viewDidLoad { [super viewDidLoad]; [self displayComposerSheet]; } -(void)displayComposerSheet { picker = [[MFMailComposeViewController alloc] init]; [[picker navigationBar] setTintColor:[UIColor blackColor]]; picker.mailComposeDelegate = self; if ([MFMailComposeViewController canSendMail]) { [picker setToRecipients:[NSArray arrayWithObjects:@"[email protected]",nil]]; [picker setSubject:@"Sample"]; } [self.view addSubview:picker.view]; [self presentModalViewController:picker animated:YES]; } - (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error { switch (result) { case MFMailComposeResultCancelled: alert = [[UIAlertView alloc] initWithTitle:@"Message Cancelled!" message:@"Your email has cancelled to send" delegate:self cancelButtonTitle:@"Dismiss" otherButtonTitles:nil]; [alert release]; break; case MFMailComposeResultSaved: alert = [[UIAlertView alloc] initWithTitle:@"Message Saved!" message:@"Your email has saved to send" delegate:self cancelButtonTitle:@"Dismiss" otherButtonTitles:nil]; [alert release]; break; case MFMailComposeResultSent: alert = [[UIAlertView alloc] initWithTitle:@"Message Sent!" message:@"Your email has to sent" delegate:self cancelButtonTitle:@"Dismiss" otherButtonTitles:nil]; [alert release];; break; case MFMailComposeResultFailed: alert = [[UIAlertView alloc] initWithTitle:@"Message Failed!" message:@"Your email has cancelled to send" delegate:self cancelButtonTitle:@"Dismiss" otherButtonTitles:nil]; [alert show]; [alert release]; break; default: alert = [[UIAlertView alloc] initWithTitle:@"Message Failed!" message:@"Your email has not to send" delegate:self cancelButtonTitle:@"Dismiss" otherButtonTitles:nil]; [alert release]; break; } [self dismissModalViewControllerAnimated:YES]; }

    Read the article

  • iTunes Music Store Link Maker — how to search from within my app?

    - by prendio2
    I'm writing a music reference app and for each album (pulled from last.fm) would like to link to the ITMS (if the album is in the store). iTunes link maker web tool http://apple.com/itunes/linkmaker/ is great for getting links for a known album but I need to access it programatically from within my app. This NSLog blogpost which is from 2003 but was referenced more recently in another question here seems to offer the only solution I've come across so far, suggesting to submit a query to: phobos.apple.com/WebObjects/MZSearch.woa/wa/advancedSearchResults? Put "itms://" before it and the link will work in iTunes, put "http://" before it and the link will work in Camino (Safari sometimes spits back a malformed XML error). The tags that are of importance are as follows: songTerm - song title artistTerm - artist name albumTerm - album name composerTerm - composer name term - all fields The suggestion is that would using http:// rather than itms:// the server will return an XML document of results instead of opening iTunes but either way I am sent directly to iTunes. Is it possible to get back a list of results?

    Read the article

  • Capture Backspace , is this a OK solution?

    - by f0rz
    Hello, I having a hard time to capture the backspace button in a UITextView. I am trying to capture it in the method - (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text I thought it was ok to do like this. if([text isEqualToString:@"\b") { // code ... } But for some reason, when backspace is pressed 'text' is empty. I know I can compare lenght of the UITextView but it isnt what I want to achieve. So I found a solution to this. If I look at '[text lenght]' every key on the defaultkeyboard returns 0 . Every key excepts the backspace wich is 0. In that way i know when backspace is pressed. I do this check. if([text lenght] == 0) { // BACKSPACE PRESSED   } What is your opinion about this? -or can I do it in a better way? Regards. - Martin

    Read the article

  • UIScrollView resizes when a UIViewController is pushed in UINavigationController. Why?

    - by user210504
    Hi! When I push a UIViewController within a UINavigationController, the UIScrollView in the view changes dimensions. Now even I am trying to resize the UIScrollView. It wont simply resize. It maintains the framework dimensions. Any idea why this would be happening. Example: My NIB has a view which has a scrollview with dimensions (320, 430) now when I push the UIViewController associated with the view the scrollview still shows dimensions has 320, 430, but is drawn much smaller then 320,430 Any suggestions in this regard.

    Read the article

  • Tableview lags, and glitches while scrolling due to images loading in each cell

    - by Luis Tovar
    Hey Guys! Me again! Can someone provide me with some example code of how to properly load images in a tablecell without making the tableview glitch while scrolling. For example if you look at fandago's app, when scrolling through their movies you can see that the image is loaded asynchronously so that the scroll isnt jumping, lagging, or glitchy. Thanks in advance. Right now I have the images loading just fine but it is glitchy as i scroll because the images are loading on main thread. I am creating an app very similar to fandango. PS I am downloading these images via xml. (you know what i mean) Thanks!!

    Read the article

  • how to rotate the Circle in DrawRect?

    - by senthilmuthu
    HI, i want to draw a circle in DrawRect through context like pie chart(took from tutorial) thorugh UITouch? i have given the code as follows,how can i rotate ? any help please? define PI 3.14159265358979323846 define snapshot_start 360 define snapshot_finish 360 static inline float radians(double degrees) { return degrees * PI / 180; } - (void)drawRect:(CGRect)rect { // Drawing code CGRect parentViewBounds = self.bounds; CGFloat x = CGRectGetWidth(parentViewBounds)/2; CGFloat y = CGRectGetHeight(parentViewBounds)*0.55; // Get the graphics context and clear it CGContextRef ctx = UIGraphicsGetCurrentContext(); CGContextClearRect(ctx, rect); // define stroke color CGContextSetRGBStrokeColor(ctx, 1, 1, 1, 1.0); // define line width CGContextSetLineWidth(ctx, 4.0); // need some values to draw pie charts double snapshotCapacity =20; double rawCapacity = 100; double systemCapacity = 1; int offset = 5; double pie1_start = 315.0; double pie1_finish = snapshotCapacity *360.0/rawCapacity; double system_finish = systemCapacity*360.0/rawCapacity; CGContextSetFillColor(ctx, CGColorGetComponents( [[UIColor greenColor] CGColor])); CGContextMoveToPoint(ctx, x+2*offset, y); CGContextAddArc(ctx, x+2*offset, y, 100, radians(snapshot_start), radians(snapshot_start+snapshot_finish), 0); CGContextClosePath(ctx); CGContextFillPath(ctx); // system capacity CGContextSetFillColor(ctx, CGColorGetComponents( [[UIColor colorWithRed:15 green:165/255 blue:0 alpha:1 ] CGColor])); CGContextMoveToPoint(ctx, x+offset,y); CGContextAddArc(ctx, x+offset, y, 100, radians(snapshot_start+snapshot_finish+offset), radians(snapshot_start+snapshot_finish+system_finish), 0); CGContextClosePath(ctx); CGContextFillPath(ctx); /* data capacity */ CGContextSetFillColor(ctx, CGColorGetComponents( [[UIColor colorWithRed:99/255 green:184/255 blue:255/255 alpha:1 ] CGColor])); CGContextMoveToPoint(ctx, x, y); CGContextAddArc(ctx, x, y, 100, radians(snapshot_start+snapshot_finish+system_finish+offset), radians(snapshot_start), 0); CGContextClosePath(ctx); CGContextFillPath(ctx); }

    Read the article

  • Bulk inserts into sqlite db on the iphone...

    - by akaii
    I'm inserting a batch of 100 records, each containing a dictonary containing arbitrarily long HTML strings, and by god, it's slow. On the iphone, the runloop is blocking for several seconds during this transaction. Is my only recourse to use another thread? I'm already using several for acquiring data from HTTP servers, and the sqlite documentation explicitly discourages threading with the database, even though it's supposed to be thread-safe... Is there something I'm doing extremely wrong that if fixed, would drastically reduce the time it takes to complete the whole operation? NSString* statement; statement = @"BEGIN EXCLUSIVE TRANSACTION"; sqlite3_stmt *beginStatement; if (sqlite3_prepare_v2(database, [statement UTF8String], -1, &beginStatement, NULL) != SQLITE_OK) { printf("db error: %s\n", sqlite3_errmsg(database)); return; } if (sqlite3_step(beginStatement) != SQLITE_DONE) { sqlite3_finalize(beginStatement); printf("db error: %s\n", sqlite3_errmsg(database)); return; } NSTimeInterval timestampB = [[NSDate date] timeIntervalSince1970]; statement = @"INSERT OR REPLACE INTO item (hash, tag, owner, timestamp, dictionary) VALUES (?, ?, ?, ?, ?)"; sqlite3_stmt *compiledStatement; if(sqlite3_prepare_v2(database, [statement UTF8String], -1, &compiledStatement, NULL) == SQLITE_OK) { for(int i = 0; i < [items count]; i++){ NSMutableDictionary* item = [items objectAtIndex:i]; NSString* tag = [item objectForKey:@"id"]; NSInteger hash = [[NSString stringWithFormat:@"%@%@", tag, ownerID] hash]; NSInteger timestamp = [[item objectForKey:@"updated"] intValue]; NSData *dictionary = [NSKeyedArchiver archivedDataWithRootObject:item]; sqlite3_bind_int( compiledStatement, 1, hash); sqlite3_bind_text( compiledStatement, 2, [tag UTF8String], -1, SQLITE_TRANSIENT); sqlite3_bind_text( compiledStatement, 3, [ownerID UTF8String], -1, SQLITE_TRANSIENT); sqlite3_bind_int( compiledStatement, 4, timestamp); sqlite3_bind_blob( compiledStatement, 5, [dictionary bytes], [dictionary length], SQLITE_TRANSIENT); while(YES){ NSInteger result = sqlite3_step(compiledStatement); if(result == SQLITE_DONE){ break; } else if(result != SQLITE_BUSY){ printf("db error: %s\n", sqlite3_errmsg(database)); break; } } sqlite3_reset(compiledStatement); } timestampB = [[NSDate date] timeIntervalSince1970] - timestampB; NSLog(@"Insert Time Taken: %f",timestampB); // COMMIT statement = @"COMMIT TRANSACTION"; sqlite3_stmt *commitStatement; if (sqlite3_prepare_v2(database, [statement UTF8String], -1, &commitStatement, NULL) != SQLITE_OK) { printf("db error: %s\n", sqlite3_errmsg(database)); } if (sqlite3_step(commitStatement) != SQLITE_DONE) { printf("db error: %s\n", sqlite3_errmsg(database)); } sqlite3_finalize(beginStatement); sqlite3_finalize(compiledStatement); sqlite3_finalize(commitStatement);

    Read the article

  • How to declare NSString constants for passing to NSNotificationCenter

    - by synic
    I've got the following in my .h file: #ifndef _BALANCE_NOTIFICATION #define _BALANCE NOTIFICATION const NSString *BalanceUpdateNotification #endif and the following in my .m file: const NSString *BalanceUpdateNotification = @"BalanceUpdateNotification"; I'm using this with the following codes: [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateBalance:) name:BalanceUpdateNotification object:nil]; and [[NSNotificatoinCenter defaultCenter] postNotificationName:BalanceUpdateNotificatoin object:self userInfo:nil]; Which works, but it gives me a warning: Passing argument 1 of 'postNotificationName:object:userInfo' discards qualifiers from pointer target type So, I can cast it to (NSString *), but I'm wondering what the proper way to do this is.

    Read the article

  • Ipad Magazines App How do they work?

    - by Terente Ionut Alexandru
    How are built the magazines apps? For example Popular Science, Auto Trends and PARIS MATCH I want to build an app like this. But how do these app render the content? How the app knows where is an video, an photo, scroll views and so on? Is there any library to use, and do this easy way or do I need my own engine that renders the content? Is just an webView that loads html5, css and java script or is much more than that?

    Read the article

< Previous Page | 137 138 139 140 141 142 143 144 145 146 147 148  | Next Page >