Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8302747
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T17:21:40+00:00 2026-06-08T17:21:40+00:00

Been battling this one for a while. Basically, I am converting an image into

  • 0

Been battling this one for a while. Basically, I am converting an image into NSData so I can send it to a server. The code I have used before, but for some reason I am getting an ARC error on this. The error lands on the line I declare the imageData variable.

NOTE: myImage is handed to the method.

- (void)uploadImage:(NSImage *)myImage {

     NSData *imageData = UIImageJPEGRepresentation(myImage, 1.0);

     // Do something...

}

I get an error and two warnings

Error: Implicit conversion of 'int' to 'NSData *' is disallowed with ARC
Warning: Implicit declaration of function 'UIImageJPEGRepresentation' is invalid in C99
Warning: Incompatible integer to pointer conversion intializing 'NSData * __strong' with an expression of type 'int'

Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T17:21:40+00:00Added an answer on June 8, 2026 at 5:21 pm

    You might need to include the relevant header:

    #import <UIKit/UIKit.h>
    

    Prior to C99, if you call a function that the compiler hasn’t seen a declaration for, it will compile the call as if the function was declared as int UIImageJPEGRepresentation(). C99 doesn’t allow that, but it seems that the compiler is still applying the old interpretation (or the compiler is in pre-C99 mode; I’m not sure what the default is), hence the ARC error.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been battling this one for a while now. I have a stored proc
I have been battling with this code for quite a while and just don't
I've been battling this XSL (Saxon/Java) code for several hours now, and still can't
Been battling with this one for what seems, like forever. I have an array:
I have been battling with this for a while, so any help would be
Hey I have been battling with this problem for a while now. Perhaps there
I have been battling with this piece of code for literally days now... Would
I've been battling to get this right...basically I have the following HTML setup: <div
I have been battling with this for a while (even used some Ant-based workarounds),
So I have been battling with this for some time and I need your

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.