You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How to read numbers file as json format DIRECTLY in objective-c/swift codes?

Hello~

Here I'm trying to use apple numbers file in my macOS application, after get path using NSBundle's pathForResource I got the correct path, but how to read the content as json string?


  1. Have tried NSString's stringWithContentOfFile:encoding:error: with UTF-8 encoding and get the error says this file cannot be read using utf-8.
  2. Also tried ASCII encoding but the content becomes two charactor "PK"..
  3. Outside objective-c codes in xcode, I have ways to convert numbers file to json strings, but I just want directly use .numbers file in xcode because need frequently modify it.. It's not elegant to manually convert it every time.


It's there any method or library can just read apple numbers file to fine encoded string?


[Edited by Moderator]

MacBook Pro 16″, macOS 13.2

Posted on Aug 26, 2024 3:27 AM

Reply
1 reply

How to read numbers file as json format DIRECTLY in objective-c/swift codes?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.