Tag: ios

IOS上的WaveForm

我正在寻找如何绘制声音的幅度。 我发现http://supermegaultragroovy.com/2009/10/06/drawing-waveforms/,但我有一些问题。 如何得到表示audio的浮点值列表?

如何使用Bitcode启用xcodebuild静态库?

Xcode 7引入了Bitcode ,它是某种LLVM中间二进制代码,意味着Apple的服务器可以在不需要我参与的情况下重新编译我的应用程序以用于不同的体系结构。 在Lookback中,我使用我们的库分发静态归档框架。 看起来,当你用“Build&Archive”构build任何东西时,bitcode实际上并没有发射到我的库中,任何人在我们的库中链接到他们的应用程序中,并试图启用Bitcode的构build和存档将获得两个警告: ld: 'Lookback(Lookback.o)' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. (如果lib是用Xcode 6编译的) ld: warning: full bitcode bundle could not be generated because 'Lookback(Lookback.o)' was built only with bitcode marker. The library […]

如何使用当前位置调用iPhone地图作为起始地址

我知道可以通过在带有位置string或纬度/ daddr参数saddr和daddr的谷歌地图URL(参见下面的示例)上调用openURL来启动iPhone地图应用程序。 但是我想知道是否可以使起始地址成为“当前位置”地图书签,以便我可以使用地图应用程序的位置处理代码。 我的谷歌search一直没有结果。 例如: [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat: @"http://maps.google.com/maps?saddr=%@&daddr=%@", myLatLong, latlong]]]; 除了调用当前位置书签来代替myLatLong 。

iphone 5的屏幕尺寸

我开发的应用程序都在iphone4和iPhone 5.Im上使用下面的代码来获得屏幕大小 CGRect screenBounds = [[UIScreen mainScreen] bounds]; 我使用的iPhone 5模拟器,但它显示的iPhone 4的屏幕尺寸。

Facebook获取朋友列表

我知道这里有很多问题,但我找不到合适的答案。 我正在使用Facebook SDK v3.18 我只是想获得用户朋友列表和他们的照片。 我已经尝试了这么多: login: FBLoginView *loginView = [[FBLoginView alloc] initWithReadPermissions: @[@"public_profile", @"email", @"user_friends"]]; // Align the button in the center horizontally loginView.frame = CGRectOffset(loginView.frame, (self.view.center.x – (loginView.frame.size.width / 2)), (self.view.center.y – (loginView.frame.size.height / 2))); [self.view addSubview:loginView]; 获取用户的好友列表及其图片: [FBRequestConnection startWithGraphPath:@"/me/friends?fields=name,picture" parameters:nil HTTPMethod:@"GET" completionHandler:^( FBRequestConnection *connection, id result, NSError *error ) { /* handle […]

用像Instagram这样的“更多”button展开UITableView中的UILabel

我有一个项目(这是由其他人写的),其中有一个饲料的内容和文本显示在一个表视图。 每个post对应于表格视图中的一个部分,每个部分都有自己的行,对应于内容,文本,像button等元素。 我需要在表格视图单元格内使用“更多”button来显示标题的简短标签,当点击更多button时,标签将展开为标题适合的任何大小,全部发生在表格视图单元格内。 当点击更多button时,我将标签的numberOfLines属性更改为零,并且由于单元格具有自动高度,所有我需要的是重新加载该特定的标题单元格。 (如果在显示单元格之前将numberOfLines设置为0,则单元格会正确显示扩展的大小。) 我试过了: [tableView beginUpdates]; tableView endUpdates]; 我已经尝试过各种animation选项: [tableView reloadRowsAtIndexPaths:@[myPath] withRowAnimation:UITableViewRowAnimation(Bottom,Top,None etc)]; 我试过了: [tableView reloadSections:[NSIndexSet indexSetWithIndex:myPath.section] withRowAnimation:UITableViewRowAnimation(Top,Bottom,None etc)]; 但他们都产生了相同的结果:整个表视图布局变得混乱:它跳转到另一个单元格,一些视图变成空白,单元格重叠,单元格内的video停止播放,标签不扩展(但刷新内部本身,如简短的预览TXT一行从顶部/底部animation,但不扩大)。 什么可能导致整个表视图的混乱,以及如何能够正确地重新加载一个单元格和扩展animation,而不会搞乱整个布局? 我已经看到了很多关于这个的问题和答案,但是他们都推荐我已经尝试和解释过的选项。 我的应用程序的目标是iOS 8.0+ 更新:这里是相关的代码(有关与布局无关的内部工作的一些部分,删除): MyCell *cell = (MyCell *)[tableView dequeueReusableCellWithIdentifier: MyCellIdentifier forIndexPath:indexPath]; cell.delegate = self; cell.indexPathToReloadOnAnimation = indexPath; cell.shouldShortenCaption = YES; id post = self.posts[indexPath.section] ; [cell setPost:post]; return cell; 而且在setPost:里面: if(self.shouldShortenCaption){ […]

如何在TabBar中设置图像不在tos颜色?

我有一个UITabbar的应用程序,我想在Tabbar中设置图像,但无法在Tabbar中设置图像。 而不是因为它是图像我得到的图像形状的色调,是否有可能设置图像,因为它是在Tabbar? 。 我试过这个代码,但无法设置图像。 UITabBar *tabBar = self.tabBar; UITabBarItem *targetTabBarItem = [[tabbar items] objectAtIndex:0]; // whichever tab-item UIImage *selectedIcon = [UIImage imageNamed:@"name-of-selected-image.png"]; [targetTabBarItem setSelectedImage:selectedIcon];

AS3的ios:如何序列化一个数组,然后保存它

我有一个multidimentional数组,我想序列化,然后使用SharedObjects保存它。 我尝试了很多东西,但每次都有问题。 JSON:不能有types。 ByteArray:结果不是String,那么SharedObject不想保存它。 可能是SharedObjects不是解决scheme的一部分。 所以我的问题是:有一个简单的解决scheme,以保存光盘上的数组,并检索这个数组? 谢谢。

如何在ios 9中使用facebook sdk 4.7获取用户的电子邮件ID

这里是我的代码,我只获取用户的用户名和Facebook的ID。 FBSDKLoginManager *login = [[FBSDKLoginManager alloc] init]; [login logInWithReadPermissions: @[@"public_profile",@"email",@"user_friends"] fromViewController:self handler:^(FBSDKLoginManagerLoginResult *result, NSError *error) { if (error) { NSLog(@"Process error"); } else if (result.isCancelled) { NSLog(@"Cancelled"); } else { if ([FBSDKAccessToken currentAccessToken]) { [[[FBSDKGraphRequest alloc] initWithGraphPath:@"me" parameters:nil] startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) { if (!error) { NSLog(@"fetched user:%@", result); } }]; } NSLog(@"Results=%@",result); […]

从块返回UIImage

我有以下代码: – (UIImage *) getPublisherLogo { //check the cache if the logo already exists NSString * imageUrl = [NSString stringWithFormat:@"%@/%@&image_type=icon", self.baseUrl, self.imageUrl_]; ASIHTTPRequest * imageRequest = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:imageUrl]]; [imageRequest setTimeOutSeconds:30.0]; [imageRequest setDownloadCache:[ASIDownloadCache sharedCache]]; [imageRequest setCacheStoragePolicy:ASICachePermanentlyCacheStoragePolicy]; [imageRequest setCachePolicy:ASIAskServerIfModifiedWhenStaleCachePolicy|ASIFallbackToCacheIfLoadFailsCachePolicy]; [imageRequest setCompletionBlock:^(void){ UIImage *img = [UIImage imageWithData:[imageRequest responseData] ]; if (img){ return img; } }]; [imageRequest setFailedBlock:^(void){ […]