目前正在开展UpnP项目.我想将我的iPod touch变成媒体服务器(例如:https://itunes.apple.com/in/app/arkmc-lite-dlna-upnp-media/id640095560?mt = 8).所以我使用了以下SDK(链接).我已成功集成,它显示在媒体服务器列表中,但是当我点击服务器时,它无法浏览媒体文件.有谁可以让我知道我的问题是什么?谢谢你的时间
这是一些简短的代码
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
upnp = [[PLT_UPnPObject alloc] init];
// create server and add ourselves as the delegate
PLT_MediaServerObject* server = [[PLT_MediaServerObject alloc] init];
[server setDelegate:self];
[upnp addDevice:server];
}
- (IBAction)performUPnPStarStop:(id)sender {
if ([upnp isRunning]) {
[upnp stop];
[mainButton setTitle:@"Start" forState:UIControlStateNormal];
} else {
[upnp start];
[mainButton setTitle:@"Stop" forState:UIControlStateNormal];
}
}
#pragma mark PLT_MediaServerDelegateObject
- (NPT_Result)onBrowseMetadata:(PLT_MediaServerBrowseCapsule*)info …Run Code Online (Sandbox Code Playgroud) 我有一些使用KVO的代码,并且在多个地方都有addObserver:forKeyPath:和removeObserver:forKeyPath : . 该应用程序偶尔会崩溃"无法移除观察者的关键路径".
我想知道是否可以安全地尝试/捕获异常以防止应用程序崩溃.我知道这不是处理KVO的最佳方法,但我需要花一些时间才能清理代码.
cocoa objective-c key-value-observing nsnotificationcenter ios
我必须为我的一个客户构建一个iOS应用程序.这个概念是如果我吹入iPhone麦克风,声音可能来自蓝牙音箱.例如,如果我在麦克风中说"嗨",应用程序应将该音频传递给蓝牙扬声器,声音应来自蓝牙扬声器.直到现在我已经完成了蓝牙配对.自从过去3天以来我一直在寻找这个,但找不到任何解决方案.请让我知道任何启动应用程序的建议或链接.
提前谢谢了
我一直在使用此代码进行推特发布.
SLComposeViewController *fbController=[SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter];
if([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter])
{
SLComposeViewControllerCompletionHandler __block completionHandler=^(SLComposeViewControllerResult result){
[fbController dismissViewControllerAnimated:YES completion:nil];
switch(result){
case SLComposeViewControllerResultCancelled:
default:
{
NSLog(@"Cancelled.....");
}
break;
case SLComposeViewControllerResultDone:
{
NSLog(@"Posted....");
UIAlertView *alertView = [[UIAlertView alloc]
initWithTitle:@"Success"
message:@"Posted Successfully"
delegate:self
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alertView show];
}
break;
}};
[fbController addImage:[UIImage imageNamed:@"1.jpg"]];
[fbController setInitialText:@"Check out this article."];
//[fbController addURL:[NSURL URLWithString:@"http://soulwithmobiletechnology.blogspot.com/"]];
[fbController setCompletionHandler:completionHandler];
[self presentViewController:fbController animated:YES completion:nil];
}
Run Code Online (Sandbox Code Playgroud)
如果用户没有设置推特帐户,则显示具有设置和取消按钮的提醒.但它没有在设备中显示警报?有人可以帮我吗.提前致谢 .

我的一个项目有问题.我在图片中有一个tableview.我的问题是我的自定义单元格背景与UITableView删除按钮重叠.任何人都可以帮我把它带到前面.
我使用下面的代码,但一些开发人员说,如果我们使用该代码Apple可能会拒绝您的应用程序
- (void)layoutSubviews
{
[super layoutSubviews];
for (UIView *subview in self.subviews) {
for (UIView *subview2 in subview.subviews) {
//NSLog(@"confirm is %@",[subview2 class]);
if ([NSStringFromClass([subview2 class]) isEqualToString:@"UITableViewCellDeleteConfirmationView"])
{
// move delete confirmation view
[subview bringSubviewToFront:subview2];
} else if ([NSStringFromClass([subview2 class]) isEqualToString:@"_UITableViewCellActionButton"])
{
[subview bringSubviewToFront:subview2];
}
}
}
}
Run Code Online (Sandbox Code Playgroud)另一个问题是下面的代码只适用于iOS 7但不适用于iOS 8.
- (BOOL)tableView:(UITableView *)tableView shouldIndentWhileEditingRowAtIndexPath:(NSIndexPath *)indexPath;方法设置为YES,我没有问题,但我们不想缩进.任何想法都可能非常有用.
我有两个 90% 相同的应用程序。所以我使用了相同的代码并在 xcode 中重命名了它。之后我将它安装在我的设备中。所以它给出的是以前的应用程序名称而不是新名称。所以请告诉我。如果您需要更多详细信息,请告诉我。
我有一个非常简单的获取请求,我想执行.我的一个实体有一个名为smartCollectionIds的属性,它的类型是可转换的.我使用此属性来存储一个NSArray简单的字符串.在我的代码中,我使用an NSfetchedResultsController来填充tableview.我使用的谓词如下:
predicate=[NSPredicate predicateWithFormat:@"smartCollectionIds!=nil && (%@ IN smartCollectionIds)",@"87F173A5-863D-4ECE-9673-A61D8F1E01FC-6285-000009A9CBAF3290"];
Run Code Online (Sandbox Code Playgroud)
但是这会导致崩溃,特别是在我执行提取时的品脱.但是,如果我首先使用fetch将所有对象加载到数组中,然后使用上面的谓词将其过滤掉,那么应用程序不会崩溃,我会按预期获得结果.所以基本上 这个代码不起作用
-(void) tryTO
{
NSEntityDescription *entity = [NSEntityDescription entityForName:@"Tweetary" inManagedObjectContext: [[ChubbyEyetwitterEngine sharedInstance] getManagedObjectContextForUse]];
NSPredicate *predicate;
predicate=[NSPredicate predicateWithFormat:@"smartCollectionIds!=nil && (%@ IN smartCollectionIds)",@"87F173A5-863D-4ECE-9673-A61D8F1E01FC-6285-000009A9CBAF3290"];
NSSortDescriptor *secondarySortKey = [[[NSSortDescriptor alloc] initWithKey:@"created_at" ascending:FALSE] autorelease];
NSFetchRequest *request = [[[NSFetchRequest alloc] init] autorelease] ;
[request setEntity:entity];
[request setPredicate:predicate];
[request setSortDescriptors:[NSArray arrayWithObjects:
secondarySortKey
,nil]];
[request setFetchLimit:30]; //30
NSError *error;
NSArray *results = [[[ChubbyEyetwitterEngine sharedInstance] getManagedObjectContextForUse] executeFetchRequest:request error:&error];
if (error != nil)
{
NSLog(@"Results are %d",[results count]); …Run Code Online (Sandbox Code Playgroud) ios ×6
objective-c ×4
xcode ×2
cocoa ×1
core-audio ×1
core-data ×1
ios8 ×1
iphone ×1
nspredicate ×1
twitter ×1