如何从UIImageView上传图片到Parse.com

我的应用程序被称为“画我”,并使用Parse.com。 用户在UIImageView中绘制图像,并将其保存(上传)到Parse.com 。 有人可以build议如何做到这一点?

在iOS 4.0中使用AVPlayer进行HTTP实时stream式传输?

是否可以在iOS 4.0上使用AVPlayer的HTTP Live Streaming? 这显然是4.0的loggingfunction。 但是,如果我在运行iOS 4.0.1的3GS上运行Apple的SitchedStreamPlayer示例代码 ,则单击“加载电影”不会播放stream,但会出现错误: 2011-06-21 13:14:49.428 StitchedStreamPlayer [680:307]资产的曲目由于错误而未被加载:无法打开 MPMediaPlayer能够在相同的设备上播放相同的stream 。 但是,我需要AVPlayer的解决scheme。 有谁知道如何让苹果的StichedStreamPlayer代码工作在4.0? 运行时需求说它应该在“iOS 4.0或更高版本”上工作。 谢谢!

如何用一个不透明的UIImagereplace另一个给定的颜色

我想改变一个不透明的UIImage的颜色。 我的原始图像如下: 我想将图像转换为以下格式 所以,基本上我想将图像中的红色转换成黑色 (任何其他颜色)的颜色。 为了更好的理解,上面添加了两张图片。

在iOS中保存和检索图像

我正在尝试将图像保存到Sqlite中,然后将图像加载到UIImageView中。 但是这不是工作。 我没有什么错。 这是我正在使用的代码。 有谁能帮我解决这个问题。 – (void)saveImage { sqlite3_stmt *compiledStmt; if(sqlite3_open([dbPath UTF8String], &db)==SQLITE_OK){ const char *insertSQL="insert into Image(Image)values(?)"; if(sqlite3_prepare_v2(db,insertSQL, -1, &compiledStmt, NULL) == SQLITE_OK){ UIImage *image = [UIImage imageNamed:@"farmhouse.png"]; NSData *imageData=UIImagePNGRepresentation(image); sqlite3_bind_blob(compiledStmt, 1, [imageData bytes], [imageData length], NULL); sqlite3_step(compiledStmt); char *errMsg; sqlite3_exec(db, insertSQL, NULL,compiledStmt,&errMsg); } } } – (void)showImage { sqlite3_stmt *compiledStmt; if(sqlite3_open([dbPath UTF8String], &db)==SQLITE_OK){ […]

iOS中的hex颜色不准确

我发现当你在xib中设置视图的backgroundColor时,显示的颜色与以编程方式设置backgroundColor的颜色明显不同。 这是一个例子。 我在这个简单的演示中有两个观点。 我在xib中设置了上层视图的backgroundColor,像这样: hex颜色值是0x1BA9BA。 然后我用相同的hex颜色值以编程方式设置较低视图的backgroundColor。 我使用下面的代码: NSInteger hexValue = 0x1ba9ba; self.testView.backgroundColor = [UIColor colorWithRed:((float)((hexValue & 0xFF0000) >> 16)) / 255.0 green:((float)((hexValue & 0xFF00) >> 8)) / 255.0 blue:((float)(hexValue & 0xFF))/255.0 alpha:1.0]; 结果如下: 正如你所看到的,颜色有明显的不同。 我在这里错过了什么?

在单个视图上的2个tableview

我需要一个例子或解释如何填充在同一个视图上的两个表视图。 我需要了解“cellForRowAtIndexPath”方法,有人可以提供一个例子,应该如何代码? 我的意思是如何识别哪个表视图? 谢谢 以下是我的cellForRowAtIndexPath方法: // Customize the appearance of table view cells. – (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; } // Configure the cell… // Set up the cell MyAppAppDelegate *appDelegate = […]

iOS应用程序首次启动

我想在用户第一次打开我的应用程序时显示欢迎屏幕。 有什么方法来检查在Swift中首次启动的应用程序?

当键盘不隐藏文本字段时移动视图

在我的应用程序中,当我点击文本字段时,键盘隐藏它。 请帮助我 – 当我点击文本字段时,如何移动我的视图。 我在textFieldDidBeginEditing:使用这个代码textFieldDidBeginEditing: self.tableView.scrollIndicatorInsets = UIEdgeInsetsMake(0, 0, 216, 0); self.tableView.contentInset = UIEdgeInsetsMake(0, 0, 216, 0); 但它不起作用。

在Objective C中设置静态variables

我似乎无法find一种方法来设置我已经创build的静态诠释为我保存到永久内存的每个对象分配唯一的ID。 下面给我一个'没有setter方法setIdGen'的财产分配。 -(void)viewDidLoad { PlayerMenuController.idGen = [[NSUserDefaults standardUserDefaults] floatForKey:@"idGen"]; } 除了上面我已经尝试创build一个静态setIdGen方法,将返回错误的访问错误,并使NSIntegers自己的设置方法。 当我尝试使用=,但使用setArray工作正常时,我的静态NSMutableArray给出了相同的错误。 idGen方法: + (int) idGen { /*static int idGen; if(!idGen) { idGen = 0; NSLog(@"idGen reset"); }*/ return self.idGen; }

保存在NSDocumentDirectory好吗?

我的应用程序正在使用NSDocumentDirectory保存图像,我只想问是否安全的方式来保存图像(最大100)。 我已经阅读了几个线程和问题的答案,虽然我不知道要跟随。有人说,它可以保存在那里。 有人说我不应该使用NSDocumentDirectory进行保存,因为它将由iCloud备份。 那么我在哪里可以保存,当用户退出应用程序,然后再次运行应用程序,那么图像应该仍然在那里? 我不太了解tmp目录或cache目录。 但是,如果它是我应该使用的2中的任何一个,我怎样才能在我的代码中使用它们: NSArray *paths = NSSearchPathForDirectoriesInDomains( NSDocumentDirectory, NSUserDomainMask ,YES ); NSString *documentsDir = [paths objectAtIndex:0]; NSString *savedImagePath = [documentsDir stringByAppendingPathComponent:[NSString stringWithFormat:@"Images%d.png", i]]; ALAssetRepresentation *rep = [[info objectAtIndex: i] defaultRepresentation]; UIImage *image = [UIImage imageWithCGImage:[rep fullResolutionImage]]; //—-resize the images image = [self imageByScalingAndCroppingForSize:image toSize:CGSizeMake(256,256*image.size.height/image.size.width)]; NSData *imageData = UIImagePNGRepresentation(image); [imageData writeToFile:savedImagePath atomically:YES]; 十分感谢你的帮助。