开发者

Cocoa - Save profile image/avatar (png) to mysql database?

开发者 https://www.devze.com 2023-02-03 19:42 出处:网络
Key point here: This is my first game, which means, I am new to develop iOS games. My game is using game center.

Key point here:

  • This is my first game, which means, I am new to develop iOS games.

  • My game is using game center.

  • From what I know, you can sign in game center on different devices, for example sign in from: UserA's iPad, or sign in from userB's iPad, or maybe sign in from userC's iPhone, thus I think I must store the profile image(avatar) to web(online) database (I am using mysql database, for the moment)

  • The profile image size is not that huge(150x200 pixels, png format), so I am thinking, store as BLOB type.

Questions:

  1. Is it good to store the image as BLOB type in my case? (I know, most of you would probably say that store image path would be better, that's why I highlight the "in my case", what I mean is that, I must assume the player might/can sign in from different devices)

  2. How to store PNG image to MySQL database? (FYI: Currently I use json(specifically: json-framework) for sendi开发者_开发技巧ng-and-receiving data, like player's username, ability, level, job from database to the device)

If you have any better ideas of storing the profile image or data, please share with me.

0

精彩评论

暂无评论...
验证码 换一张
取 消