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 6669041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:06:20+00:00 2026-05-26T03:06:20+00:00

I’m hoping someone will be able to point me in the right direction. I’m

  • 0

I’m hoping someone will be able to point me in the right direction. I’m new to iOS/Objective C, but familiar with classic ASP/PHP.

I’m trying to dynamically generate CGRects (filled ellipses) using data from an SQLite database. I am able to connect to the SQLite database and pull an array, so that’s working. You’ll see that I have my CGRect goal successfully writing to the NSLog, along with manually drawing two dots.

I just need a little push in the right direction as far as the best method to place items from the “record set” into the CGRect line, in a similar method to how I have it sent to the NSLog.

My working CGRect code:

- (void)drawRect:(CGRect)rect {

CGContextRef context = UIGraphicsGetCurrentContext();

// Set dot alpha transparency
CGContextSetAlpha(context, 0.70);

// And draw with a blue fill color
CGContextSetRGBFillColor(context, 0.0, 0.0, 1.0, 1.0);

// Fill rect convenience equivalent to AddEllipseInRect(); FillPath();
int ellipseDiameter = 35.0;
int drawOffset = ellipseDiameter / 2;

//NSArray into NSLog showing how CGRect should be formatted from SQLite data
NSArray *locationInfos = [LocationDatabase database].locationInfos;
for (LocationInfo *info in locationInfos) {
    NSLog(@"CGContextFillEllipseInRect(context, CGRectMake(%@ - drawOffset, %@ - drawOffset, ellipseDiameter,ellipseDiameter))", info.xCoordText, info.yCoordText);
}

//drawing dot 1 
CGContextFillEllipseInRect(context, CGRectMake(125.0 - drawOffset, 108.0 - drawOffset, ellipseDiameter, ellipseDiameter));

//drawing dot 2
CGContextFillEllipseInRect(context, CGRectMake(132.0 - drawOffset, 146.0 - drawOffset, ellipseDiameter, ellipseDiameter));    
}

Any direction would really be appreciated. Thanks in advance!

  • 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-05-26T03:06:20+00:00Added an answer on May 26, 2026 at 3:06 am

    info.xCoordText and info.yCoordText are NSString, just call [info.xCoordText floatValue] to turn them into floats.

    i.e.:

    CGContextFillEllipseInRect(context, CGRectMake(info.xCoordText.floatValue - drawOffset, info.yCoordText.floatValue - drawOffset, ellipseDiameter,ellipseDiameter));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
this is what i have right now Drawing an RSS feed into the php,
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
This could be a duplicate question, but I have no idea what search terms
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I need a function that will clean a strings' special characters. I do NOT
I want to construct a data frame in an Rcpp function, but when I

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.