小编Bab*_*bul的帖子

如何以编程方式选择地图引脚

我是Maps Concept的新手.

请找一次附图.

在此输入图像描述

当我点击"pin"时,我收到消息说"欣赏你的笑容"或任何文字.....现在我想要...当我们选择表视图时,我需要为该引脚提出该消息(与该针的用户交互)...

我在下面的代码中使用了这个地图和引脚.

    -(void) viewWillAppear:(BOOL)animated
{
[super viewWillAppear:YES];
customLocation.latitude=[casesobjc.latitude_string doubleValue];
        customLocation.longitude=[casesobjc.longitude_string doubleValue];
 MapViewAnnotation *newAnnotation = [[MapViewAnnotation alloc] initWithTitle:casesobjc.locationForMap_string andCoordinate:customLocation];
[mapView addAnnotation:newAnnotation];
}
- (MKAnnotationView *) mapView: (MKMapView *) mapView viewForAnnotation: (id<MKAnnotation>) annotation {
 MKPinAnnotationView *pin = (MKPinAnnotationView *) [mapView dequeueReusableAnnotationViewWithIdentifier: @"annotation_ID"];
if (pin == nil) {
        pin = [[MKPinAnnotationView alloc] initWithAnnotation: annotation reuseIdentifier: @"annotation_ID"];
    } else {
        pin.annotation = annotation;
    }
    pin.pinColor = MKPinAnnotationColorPurple;
    pin.animatesDrop = YES;
    pin.canShowCallout=YES;
return pin;
}
Run Code Online (Sandbox Code Playgroud)

现在我将如下所示显示所有引脚.

在此输入图像描述

怎么做当我们点击表视图时,我需要显示该引脚的标题,就像我们选择引脚时的显示方式一样?

提前致谢

iphone objective-c map mkmapview ios

22
推荐指数
2
解决办法
1万
查看次数

iOS 6问题将MPMediaItem转换为NSData

我曾尝试过以下代码.

   -(void)mediaItemToData : (MPMediaItem * ) curItem
{
    NSURL *url = [curItem valueForProperty: MPMediaItemPropertyAssetURL];

    AVURLAsset *songAsset = [AVURLAsset URLAssetWithURL: url options:nil];

    AVAssetExportSession *exporter = [[AVAssetExportSession alloc] initWithAsset: songAsset
                                                                      presetName:AVAssetExportPresetPassthrough];

    exporter.outputFileType =  @"public.mpeg-4";

    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString * myDocumentsDirectory = ([paths count] > 0) ? [paths objectAtIndex:0] : nil;

    NSString *exportFile = [myDocumentsDirectory stringByAppendingPathComponent:
                            @"exported.mp4"];

    NSURL *exportURL = [NSURL fileURLWithPath:exportFile];
    exporter.outputURL = exportURL;

    // do the export
    // (completion handler block omitted)
    [exporter exportAsynchronouslyWithCompletionHandler:
     ^{
         NSData *data = …
Run Code Online (Sandbox Code Playgroud)

iphone objective-c mpmediaitem avassetexportsession ios6

7
推荐指数
1
解决办法
4405
查看次数

使用ios6无法识别的选择器中的facebook登录并发送到实例"

当我使用Facebook登录时,我收到以下错误

是的,这是一个基本的错误"无法识别的选择器发送到实例"但我没有得到错误的地方

[UIStatusBar orientation]: unrecognized selector sent to instance 0xa9a9c00
2012-11-23 11:15:46.854 Tattoo Later[1265:1cd03] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIStatusBar orientation]: unrecognized selector sent to instance 0xa9a9c00'
Run Code Online (Sandbox Code Playgroud)

在这个方法中

- (void)loginToFacebook:(id) loginDelegate
{
fbServiceRequestingobj = loginDelegate;
 NSArray* permissions = [[NSArray alloc] initWithObjects:
                            @"publish_stream",@"user_birthday",@"read_stream",@"user_about_me",@"offline_access",@"email",@"read_mailbox",@"user_about_me",nil];
 [facebook authorize:permissions delegate:self];
}
Run Code Online (Sandbox Code Playgroud)

应用程序崩溃在这一行 [facebook authorize:permissions delegate:self];

在我的项目中,我整合了"GPUImage",我正在研究ios6

提前致谢

iphone objective-c ipad ios

6
推荐指数
1
解决办法
378
查看次数

如果我们通过NSData,如何播放音频?

我转换了这个路径(文件://localhost/var/mobile/Applications/8F81BA4C-7C6F-4496-BDA7-30C45478D758/Documents/sound.wav),这是一个音频文件,即记录.

我正在将此路径转换为NSData.

NSData是:示例:

<00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 64617461 1cf50200 32003200 e2ffe2ff 3cff3cff 08fe08fe 44fe44fe 04fe04fe e6fde6fd 95fd95fd 96fe96fe b9feb9fe ........................................................................................................................f7fef7fe 96ff96ff bdffbdff d6ffd6ff 92009200 23012301 b200b200 79007900 5c015c01 fe01fe01 f101f101 fc01fc01 7b027b02 36023602 >
Run Code Online (Sandbox Code Playgroud)

我想玩这个NSData,

我确实喜欢下面

NSString *urlString = [[NSString alloc] initWithData:appDelegate.dataTestingWasteData encoding:NSUTF8StringEncoding];
NSURL *url = [[NSURL alloc] initWithString:urlString];
self.palyer=[[AVPlayer alloc] initWithURL:url];
[self.palyer play];
Run Code Online (Sandbox Code Playgroud)

但是没有播放,urlString打印为空.

同样的道路 (file://localhost/var/mobile/Applications/8F81BA4C-7C6F-4496-BDA7-30C45478D758/Documents/sound.wav)

如果我们使用以下代码正在播放:

-(void)playAudio
{
    if (!audioRecorder.recording)
    {
        stopButton.enabled = …
Run Code Online (Sandbox Code Playgroud)

iphone objective-c audio-recording avaudioplayer ios

6
推荐指数
1
解决办法
1万
查看次数

如何获取我在iphone中向其发送电子邮件的数据

我想显示一个电子邮件列表,我从我的应用程序发送电子邮件.(我没有从我的iPhone收到电子邮件).我希望在"收件人"地址中输入电子邮件.

提前致谢

iphone objective-c

5
推荐指数
1
解决办法
143
查看次数

在服务器上它正在上传,但pdf没有打开它说附件有一些错误

我在我的iphone应用程序中生成了pdf,现在我想将该pdf发送到服务器.因为我正在转换为NSData而我正在发送.

我在谷歌搜索,我通过使用"POST"找到解决方案,但它适用于图像.

在服务器上它正在上传,但pdf没有打开它说附件有一些错误

在下面的代码中我做了这个:

NSData *pdfdata = [[NSData alloc] initWithData:[self.pdfFilePath dataUsingEncoding:NSASCIIStringEncoding]];
ASIFormDataRequest *request=[ASIFormDataRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",MainUrl,@"updatefile.php"]]];
[request setDelegate:self];
        [request setPostValue:appDelegate.userId forKey:@"userid"];
         [request addData:pdfdata forKey:@"file"];
[request startSynchronous];
Run Code Online (Sandbox Code Playgroud)

//self.pdfFilePath = /var/folders/a0/a01nF1oGGkebQxw7H0YsBU+++TI/-Tmp-/MyAccount.pdf;

请指导我,

提前致谢.

iphone objective-c asihttprequest ios

5
推荐指数
1
解决办法
208
查看次数

使用 SDWebImage 下载图像,错误 -999(或)SDWebImageErrorDomain Code=0 “下载的图像有 0 像素

我无法使用 SDWebImage 4.4.5 版本在 Objective c 中下载图像。我尝试了以下方法,但没有任何效果。

尝试 1:

[self.thumbnailImageView sd_setImageWithURL:[NSURL URLWithString:thumbnailURLString] completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) {
Run Code Online (Sandbox Code Playgroud)

}];

尝试2:

[self.thumbnailImageView sd_setImageWithURL:[NSURL URLWithString:thumbnailURLString] placeholderImage:nil options:SDWebImageRefreshCached completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { if(image != nil){
            self.thumbnailImageView.image = image;                
        } else {
            NSLog(@"Photo Not Available, fetch");
            [self.thumbnailImageView sd_setImageWithURL:[NSURL URLWithString:thumbnailURLString] placeholderImage:nil options:SDWebImageRefreshCached completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
                if(image != nil) { NSLog(@"Lo Res Image Loaded by %ld …
Run Code Online (Sandbox Code Playgroud)

iphone objective-c ios sdwebimage

5
推荐指数
1
解决办法
1725
查看次数

我们可以将NSDecimal值转换为UIImage吗?

我发送一些数据和UIImage(将UIImage转换为NSData)发送到服务器,我的客户端正在回复我们发送的响应.

但是,我的客户端给出了UIImage,如下面的格式

FaceImage":[255,216,255,224,0,16,74,70,73,70,0,1,1,1,1,44,1,44,0,0,255,219,0,67,0,8,6,6,7,6,5,8,7,7,7,9,9,8,10,12,20,13,12,11,11,12,25,18,19,15,20,29,26,31,30,29,26,28,28,32,36,46,39,32,34,44,35,28,28,40,55,41,44,48,49,52,52,52,31,39,57,61,56,50,60,46,51,52,50,255,219,0,67,1,9,9,9,12,11,12,24,13,13,24,50,.................................................................]
Run Code Online (Sandbox Code Playgroud)

我测试了上面的一个来测试我们使用这个日志获得了什么

NSLog(@"testingImageView.image is =%@",[[[datadic valueForKey:@"FaceImage"] objectAtIndex:0] class]);
Run Code Online (Sandbox Code Playgroud)

响应是: testingImageView.image = NSDecimal.

如果它是NSData我们可以转换为UIImage,但这里是十进制格式.

我的问题是,我可以将其转换为UIImage吗?即,UIImage的十进制值.

提前致谢.

iphone image objective-c nsdecimalnumber ios

4
推荐指数
1
解决办法
147
查看次数

需要XMPP框架

我正在进行ejabberd设置,我成功配置了服务器,但在客户端,我们需要XMPP Framework,

我用谷歌搜索我得到以下链接

http://deusty.blogspot.in/2008/08/xmppframework-on-iphone.html

http://iphone4developer.blogspot.in/2011/07/how-to-add-xmpp-in-your-ios-project.html

我下载了robbiehanson/XMPPFramework,但它会抛出错误,有些链接给我404错误(删除了)

我从这个链接(https://github.com/funkyboy/Building-a-Jabber-client-for-iOS)下载了jabber客户端,但xmpp框架文件从应用程序中抛出错误(已经删除了)

我有一个样本是iPhoneXMPP样本,但它抛出的错误是" 无法连接到服务器.检查xmppStream.hostName "我在willSecureWithSettings方法中给出了我的主机名

释疑:

1)请指导我下载正确的XMPP框架,没有错误

2)如何配置ejabber客户端?

请指导我

非常感谢提前

iphone objective-c ios xmppframework

2
推荐指数
1
解决办法
7347
查看次数