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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T02:23:16+00:00 2026-05-18T02:23:16+00:00

I am using an example from WordNik samples-sdk, I killed most memory leaks but

  • 0

I am using an example from WordNik samples-sdk, I killed most memory leaks but there’s a warning that I can’t understand what it is and how to fix it!

I have asked help on their Google group but while they answered to pretty much to every question that I asked, they keep ignoring this one, I am hopeful that the collective brain of stackoverflow solves the problem.

This file generates a warning on iPad/iPhone – file where the warning is generated.

Wordnik/WordService.m: In function '-[WordService fetchDefinitions:useCanonical:]':
Wordnik/WordService.m:52: warning: incompatible Objective-C types initializing 'struct Word *', expected 'struct Definition *'

The whole sdk-sample is here.

  • 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-18T02:23:17+00:00Added an answer on May 18, 2026 at 2:23 am

    I think you meant to link to this file. On line 52 we find this:

    Definition * def = [[Definition alloc]init:dict];
    

    The compiler can’t work out whether the init: method refers to (Word *)init: from the Word class or (Definition *)init: from the Definition class. It’s incorrectly guessing that it’s the method from the Word class and therefore giving you a warning that you’re initialising a Definition* variable with a Word* object.

    It’s solvable with a cast like so:

    Definition * def = [((Definition *)[Definition alloc]) init:dict];
    

    Or even:

    Definition * def = (Definition *) [[Definition alloc]init:dict];
    

    And no, the compiler isn’t smart enough to realise that [Definition alloc] probably returns a Definition object.

    (I can’t help but mention that whoever wrote that sample code has a very casual attitude to releasing/autoreleasing objects and an apparent love of memory leaks. In that one file word is never releaed, none of the values stored in def are ever released and nor is definitions)

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

Sidebar

Related Questions

I am using the example from TheElements sample code provided with the iPhone SDK
I'm working for the first time with Forms Authentication, I'm using an example from
For example, mysql quote table name using SELECT * FROM `table_name`; notice the `
A friend of mine claims that in a typical database, using (for example) nvarchar[256]
For example: using System; using System.Web; using System.Collections; using System.Web.Services; using System.Web.Services.Protocols; using System.Web.Script.Serialization;
I am using the example on the AJAX website for the DropDownExtender . I'm
i'm using this example implementation found at http://tangentsoft.net/wskfaq/examples/basics/select-server.html This is doing most of what
Does anyone have an example using the table object in YUI library. More specifically,
How much should one DataSet represent? Using the example of an ordering system: While
It is easy to highlight a selected datagrid row, by for example using toggleClass

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.