所以我试图通过我的应用程序链接到iOS6上的Facebook页面
NSString* urlString = @"https://www.facebook.com/vioside";
[[UIApplication sharedApplication] openURL:[NSURL URLWithString: urlString]];
Run Code Online (Sandbox Code Playgroud)
这会成功打开Facebook应用程序,但它不会在我的页面上显示.任何人都知道如何在iOS6上正确链接?
我正在尝试以Excel格式创建报告,准备通过电子邮件发送.到目前为止,我发现最好和最简单的方法是创建一个xml文档,如下所示并保存为xls.
<?xml version="1.0"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:html="http://www.w3.org/TR/REC-html40">
<Worksheet ss:Name="Sheet1">
<Table ss:ExpandedColumnCount="2" ss:ExpandedRowCount="2" x:FullColumns="1" x:FullRows="1">
<Row>
<Cell><Data ss:Type="String">Name</Data></Cell>
<Cell><Data ss:Type="String">Example</Data></Cell>
</Row>
<Row>
<Cell><Data ss:Type="String">Value</Data></Cell>
<Cell><Data ss:Type="Number">123</Data></Cell>
</Row>
</Table>
</Worksheet>
</Workbook>
Run Code Online (Sandbox Code Playgroud)
然后我可以使用保存此文档
NSArray *documentDirectoryPath = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *docDir = [NSString stringWithFormat:@"%@/Report.xls", [documentDirectoryPath objectAtIndex:0]];
[xmlString writeToFile:docDir atomically:YES encoding:NSUTF8StringEncoding error:NULL];
[serializedData writeToFile:docDir atomically:YES];
Run Code Online (Sandbox Code Playgroud)
但是,在我发送电子邮件并尝试打开xls文件后,xml将显示在电子表格中.有谁能请我指向正确的方向来创建这个xls文件?
我有一个餐厅和氛围的核心数据结构,餐厅可以有很多的气氛,气氛可以有很多餐厅.所以我建立了两对多关系,两者都是苹果文档中所述的相反,形成了多对多的关系.
但是我在创建的集合中添加对象时遇到了麻烦.例如,当我使用这样的代码时,
Atmosphere *atmosphere = [Atmosphere atmosphere:aId inManagedObjectContext:context];
[restaurant addAtmospheresObject:atmosphere];
Run Code Online (Sandbox Code Playgroud)
它崩溃了一个奇怪的错误:
EXC_BREAKPOINT (code=EXC_I386_BPT, subcode=0x0)
Run Code Online (Sandbox Code Playgroud)
有没有人遇到过这个?
ios ×2
iphone ×2
objective-c ×2
core-data ×1
facebook ×1
ios6 ×1
many-to-many ×1
xls ×1
xml ×1